294 lines
8.3 KiB
Plaintext
294 lines
8.3 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import pandas as pd"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"merged_manifest = pd.read_csv('0207_contributing_merged_manifest.csv')\n",
|
|
"topic_distributions = pd.read_csv('020725_CONTRIBUTING_file_topic_distributions.csv')\n",
|
|
"readability_scores = pd.read_csv('020725_CONTRIBUTING_readability.csv')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"714"
|
|
]
|
|
},
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"first_merge = readability_scores.merge(topic_distributions, on=['filename'],how=\"inner\")\n",
|
|
"#primary_merge = first_merge.merge(readability_scores, )\n",
|
|
"first_merge['new_filepath'] = first_merge['filename']\n",
|
|
"second_merge = first_merge.merge(merged_manifest, on=['new_filepath'], how=\"inner\")\n",
|
|
"len(second_merge)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead tr th {\n",
|
|
" text-align: left;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead tr:last-of-type th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr>\n",
|
|
" <th></th>\n",
|
|
" <th colspan=\"2\" halign=\"left\">flesch_reading_ease</th>\n",
|
|
" <th colspan=\"2\" halign=\"left\">reading_time</th>\n",
|
|
" <th colspan=\"2\" halign=\"left\">word_count</th>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th></th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>median</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>median</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>median</th>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>ranef_grouping</th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>42.566929</td>\n",
|
|
" <td>50.02</td>\n",
|
|
" <td>25.150787</td>\n",
|
|
" <td>12.720</td>\n",
|
|
" <td>279.196850</td>\n",
|
|
" <td>127.0</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>46.039942</td>\n",
|
|
" <td>52.80</td>\n",
|
|
" <td>31.453844</td>\n",
|
|
" <td>18.715</td>\n",
|
|
" <td>356.794798</td>\n",
|
|
" <td>220.5</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>48.247676</td>\n",
|
|
" <td>55.54</td>\n",
|
|
" <td>36.950290</td>\n",
|
|
" <td>24.900</td>\n",
|
|
" <td>426.473029</td>\n",
|
|
" <td>273.0</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" flesch_reading_ease reading_time word_count \\\n",
|
|
" mean median mean median mean \n",
|
|
"ranef_grouping \n",
|
|
"0 42.566929 50.02 25.150787 12.720 279.196850 \n",
|
|
"1 46.039942 52.80 31.453844 18.715 356.794798 \n",
|
|
"2 48.247676 55.54 36.950290 24.900 426.473029 \n",
|
|
"\n",
|
|
" \n",
|
|
" median \n",
|
|
"ranef_grouping \n",
|
|
"0 127.0 \n",
|
|
"1 220.5 \n",
|
|
"2 273.0 "
|
|
]
|
|
},
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"readability_aggregate = second_merge.groupby('ranef_grouping').agg({\n",
|
|
" 'flesch_reading_ease' : ['mean', 'median'],\n",
|
|
" 'reading_time' : ['mean', 'median'],\n",
|
|
" 'word_count' : ['mean', 'median'],\n",
|
|
"})\n",
|
|
"\n",
|
|
"readability_aggregate"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead tr th {\n",
|
|
" text-align: left;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead tr:last-of-type th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr>\n",
|
|
" <th></th>\n",
|
|
" <th>t0</th>\n",
|
|
" <th>t1</th>\n",
|
|
" <th>t2</th>\n",
|
|
" <th>t3</th>\n",
|
|
" <th>t4</th>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th></th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>mean</th>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>ranef_grouping</th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" <th></th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>0.090202</td>\n",
|
|
" <td>0.052087</td>\n",
|
|
" <td>0.500535</td>\n",
|
|
" <td>0.184244</td>\n",
|
|
" <td>0.172932</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>0.112142</td>\n",
|
|
" <td>0.099278</td>\n",
|
|
" <td>0.451561</td>\n",
|
|
" <td>0.115016</td>\n",
|
|
" <td>0.222003</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>0.094379</td>\n",
|
|
" <td>0.126244</td>\n",
|
|
" <td>0.535289</td>\n",
|
|
" <td>0.072569</td>\n",
|
|
" <td>0.171519</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" t0 t1 t2 t3 t4\n",
|
|
" mean mean mean mean mean\n",
|
|
"ranef_grouping \n",
|
|
"0 0.090202 0.052087 0.500535 0.184244 0.172932\n",
|
|
"1 0.112142 0.099278 0.451561 0.115016 0.222003\n",
|
|
"2 0.094379 0.126244 0.535289 0.072569 0.171519"
|
|
]
|
|
},
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"topic_aggregate = second_merge.groupby('ranef_grouping').agg({\n",
|
|
" 't0' : ['mean'],\n",
|
|
" 't1' : ['mean'],\n",
|
|
" 't2' : ['mean'],\n",
|
|
" 't3' : ['mean'],\n",
|
|
" 't4' : ['mean']\n",
|
|
"})\n",
|
|
"\n",
|
|
"topic_aggregate"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "base",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.12.2"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|