Commit 3f0abcc0 authored by Orkut Karaçalık's avatar Orkut Karaçalık
Browse files

update

parent 8f50bf93
......@@ -6,6 +6,7 @@ import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
from scipy.stats import entropy
from functools import reduce
def get_unique_fields(df, col='conference_fields'):
......@@ -76,6 +77,14 @@ df_h_index_per_year = group_by_years(df_h_index)
df_h_index_per_year_per_fields = group_by_years_fields(df_h_index, years, fields) # { y: { f: df_h_index_per_year[y][df_h_index_per_year[y].conference_fields.apply(lambda x: f in x)] for f in fields } for y in df_h_index_per_year.keys() }
#get_distribution_plot(df_h_index)
get_distribution_plot(df_h_index_per_year)
#get_distribution_plot(df_h_index_per_year_per_fields)
#a = get_unique_fields(df_h_index_per_year_per_fields[2017]['human-computer-interaction'], 'gender')
\ No newline at end of file
#get_distribution_plot(df_h_index_per_year)
get_distribution_plot(df_h_index_per_year_per_fields)
#a = get_unique_fields(df_h_index_per_year_per_fields[2017]['human-computer-interaction'], 'gender')
female = df_h_index.groupby('gender').get_group('female')['h_index']
male = df_h_index.groupby('gender').get_group('male')['h_index']
pmf_female, bins_female = np.histogram(female, density=True)
pmf_male, bins_male = np.histogram(male, density=True)
dist_f = dict(zip(bins_female, pmf_female))
dist_m = dict(zip(bins_male, pmf_male))
answer = entropy(pmf_female, pmf_male)
This diff is collapsed.
......@@ -475,11 +475,11 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 16,
"metadata": {
"ExecuteTime": {
"end_time": "2018-07-10T13:29:09.735397Z",
"start_time": "2018-07-10T13:29:09.584155Z"
"end_time": "2018-07-10T16:43:19.785683Z",
"start_time": "2018-07-10T16:43:19.676080Z"
}
},
"outputs": [
......@@ -495,10 +495,37 @@
}
],
"source": [
"plt.hist(women, bins=5)\n",
"arr = plt.hist(women, bins=5)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"ExecuteTime": {
"end_time": "2018-07-10T16:46:45.371022Z",
"start_time": "2018-07-10T16:46:45.365506Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"array([0.00534188, 0.01602564, 0.02136752, 0.02136752, 0.02136752,\n",
" 0.0267094 , 0.00534188, 0.01068376, 0.00534188, 0.00534188])"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pmf, bins = np.histogram(women, density=True)\n",
"pmf"
]
},
{
"cell_type": "code",
"execution_count": 11,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment