parttion analysis of topic distributions and readability
This commit is contained in:
		
							parent
							
								
									1c003a6265
								
							
						
					
					
						commit
						4917c423c6
					
				
							
								
								
									
										293
									
								
								text_analysis/contributing_partitioned_analysis.ipynb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										293
									
								
								text_analysis/contributing_partitioned_analysis.ipynb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,293 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					 "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('0203_contributing_merged_manifest.csv')\n",
 | 
				
			||||||
 | 
					    "topic_distributions = pd.read_csv('020125_CONTRIBUTING_file_topic_distributions.csv')\n",
 | 
				
			||||||
 | 
					    "readability_scores = pd.read_csv('020125_CONTRIBUTING_readability.csv')"
 | 
				
			||||||
 | 
					   ]
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					   "cell_type": "code",
 | 
				
			||||||
 | 
					   "execution_count": 3,
 | 
				
			||||||
 | 
					   "metadata": {},
 | 
				
			||||||
 | 
					   "outputs": [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					     "data": {
 | 
				
			||||||
 | 
					      "text/plain": [
 | 
				
			||||||
 | 
					       "715"
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					     },
 | 
				
			||||||
 | 
					     "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['fvf_filepath'] = first_merge['filename']\n",
 | 
				
			||||||
 | 
					    "second_merge = first_merge.merge(merged_manifest, on=['fvf_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>46.102071</td>\n",
 | 
				
			||||||
 | 
					       "      <td>49.99</td>\n",
 | 
				
			||||||
 | 
					       "      <td>23.409286</td>\n",
 | 
				
			||||||
 | 
					       "      <td>13.720</td>\n",
 | 
				
			||||||
 | 
					       "      <td>259.635714</td>\n",
 | 
				
			||||||
 | 
					       "      <td>153.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>1</th>\n",
 | 
				
			||||||
 | 
					       "      <td>44.237276</td>\n",
 | 
				
			||||||
 | 
					       "      <td>53.41</td>\n",
 | 
				
			||||||
 | 
					       "      <td>29.065789</td>\n",
 | 
				
			||||||
 | 
					       "      <td>16.880</td>\n",
 | 
				
			||||||
 | 
					       "      <td>329.151703</td>\n",
 | 
				
			||||||
 | 
					       "      <td>198.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>2</th>\n",
 | 
				
			||||||
 | 
					       "      <td>47.432222</td>\n",
 | 
				
			||||||
 | 
					       "      <td>54.78</td>\n",
 | 
				
			||||||
 | 
					       "      <td>34.361627</td>\n",
 | 
				
			||||||
 | 
					       "      <td>23.365</td>\n",
 | 
				
			||||||
 | 
					       "      <td>394.242063</td>\n",
 | 
				
			||||||
 | 
					       "      <td>252.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                        46.102071  49.99    23.409286  13.720  259.635714   \n",
 | 
				
			||||||
 | 
					       "1                        44.237276  53.41    29.065789  16.880  329.151703   \n",
 | 
				
			||||||
 | 
					       "2                        47.432222  54.78    34.361627  23.365  394.242063   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "                       \n",
 | 
				
			||||||
 | 
					       "               median  \n",
 | 
				
			||||||
 | 
					       "ranef_grouping         \n",
 | 
				
			||||||
 | 
					       "0               153.0  \n",
 | 
				
			||||||
 | 
					       "1               198.0  \n",
 | 
				
			||||||
 | 
					       "2               252.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.093281</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.368268</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.156304</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.098748</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.283398</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>1</th>\n",
 | 
				
			||||||
 | 
					       "      <td>0.157519</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.281908</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.185817</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.112195</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.262561</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>2</th>\n",
 | 
				
			||||||
 | 
					       "      <td>0.202565</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.252555</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.167163</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.090678</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.287039</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.093281  0.368268  0.156304  0.098748  0.283398\n",
 | 
				
			||||||
 | 
					       "1               0.157519  0.281908  0.185817  0.112195  0.262561\n",
 | 
				
			||||||
 | 
					       "2               0.202565  0.252555  0.167163  0.090678  0.287039"
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					     },
 | 
				
			||||||
 | 
					     "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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
 "cells": [
 | 
					 "cells": [
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
   "cell_type": "code",
 | 
					   "cell_type": "code",
 | 
				
			||||||
   "execution_count": 3,
 | 
					   "execution_count": 1,
 | 
				
			||||||
   "metadata": {},
 | 
					   "metadata": {},
 | 
				
			||||||
   "outputs": [],
 | 
					   "outputs": [],
 | 
				
			||||||
   "source": [
 | 
					   "source": [
 | 
				
			||||||
@ -11,7 +11,7 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
   "cell_type": "code",
 | 
					   "cell_type": "code",
 | 
				
			||||||
   "execution_count": 5,
 | 
					   "execution_count": 2,
 | 
				
			||||||
   "metadata": {},
 | 
					   "metadata": {},
 | 
				
			||||||
   "outputs": [],
 | 
					   "outputs": [],
 | 
				
			||||||
   "source": [
 | 
					   "source": [
 | 
				
			||||||
@ -22,7 +22,7 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
   "cell_type": "code",
 | 
					   "cell_type": "code",
 | 
				
			||||||
   "execution_count": 10,
 | 
					   "execution_count": 3,
 | 
				
			||||||
   "metadata": {},
 | 
					   "metadata": {},
 | 
				
			||||||
   "outputs": [
 | 
					   "outputs": [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -31,7 +31,7 @@
 | 
				
			|||||||
       "4248"
 | 
					       "4248"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
     },
 | 
					     },
 | 
				
			||||||
     "execution_count": 10,
 | 
					     "execution_count": 3,
 | 
				
			||||||
     "metadata": {},
 | 
					     "metadata": {},
 | 
				
			||||||
     "output_type": "execute_result"
 | 
					     "output_type": "execute_result"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -43,6 +43,482 @@
 | 
				
			|||||||
    "second_merge = first_merge.merge(merged_manifest, on=['fvf_filepath'], how=\"inner\")\n",
 | 
					    "second_merge = first_merge.merge(merged_manifest, on=['fvf_filepath'], how=\"inner\")\n",
 | 
				
			||||||
    "len(second_merge)"
 | 
					    "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 th {\n",
 | 
				
			||||||
 | 
					       "        text-align: right;\n",
 | 
				
			||||||
 | 
					       "    }\n",
 | 
				
			||||||
 | 
					       "</style>\n",
 | 
				
			||||||
 | 
					       "<table border=\"1\" class=\"dataframe\">\n",
 | 
				
			||||||
 | 
					       "  <thead>\n",
 | 
				
			||||||
 | 
					       "    <tr style=\"text-align: right;\">\n",
 | 
				
			||||||
 | 
					       "      <th></th>\n",
 | 
				
			||||||
 | 
					       "      <th>filename</th>\n",
 | 
				
			||||||
 | 
					       "      <th>flesch_reading_ease</th>\n",
 | 
				
			||||||
 | 
					       "      <th>flesch_kincaid_grade</th>\n",
 | 
				
			||||||
 | 
					       "      <th>linsear_write_formula</th>\n",
 | 
				
			||||||
 | 
					       "      <th>dale_chall_readability_score</th>\n",
 | 
				
			||||||
 | 
					       "      <th>mcalpine_eflaw</th>\n",
 | 
				
			||||||
 | 
					       "      <th>reading_time</th>\n",
 | 
				
			||||||
 | 
					       "      <th>char_count</th>\n",
 | 
				
			||||||
 | 
					       "      <th>word_count</th>\n",
 | 
				
			||||||
 | 
					       "      <th>t0</th>\n",
 | 
				
			||||||
 | 
					       "      <th>...</th>\n",
 | 
				
			||||||
 | 
					       "      <th>effect</th>\n",
 | 
				
			||||||
 | 
					       "      <th>group</th>\n",
 | 
				
			||||||
 | 
					       "      <th>level</th>\n",
 | 
				
			||||||
 | 
					       "      <th>term</th>\n",
 | 
				
			||||||
 | 
					       "      <th>estimate</th>\n",
 | 
				
			||||||
 | 
					       "      <th>std.error</th>\n",
 | 
				
			||||||
 | 
					       "      <th>conf.low</th>\n",
 | 
				
			||||||
 | 
					       "      <th>conf.high</th>\n",
 | 
				
			||||||
 | 
					       "      <th>ranef_grouping</th>\n",
 | 
				
			||||||
 | 
					       "      <th>rank</th>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "  </thead>\n",
 | 
				
			||||||
 | 
					       "  <tbody>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>0</th>\n",
 | 
				
			||||||
 | 
					       "      <td>libevent_libevent_hullabaloo_README</td>\n",
 | 
				
			||||||
 | 
					       "      <td>50.36</td>\n",
 | 
				
			||||||
 | 
					       "      <td>11.4</td>\n",
 | 
				
			||||||
 | 
					       "      <td>14.625000</td>\n",
 | 
				
			||||||
 | 
					       "      <td>12.47</td>\n",
 | 
				
			||||||
 | 
					       "      <td>26.3</td>\n",
 | 
				
			||||||
 | 
					       "      <td>7.37</td>\n",
 | 
				
			||||||
 | 
					       "      <td>502</td>\n",
 | 
				
			||||||
 | 
					       "      <td>83</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.001976</td>\n",
 | 
				
			||||||
 | 
					       "      <td>...</td>\n",
 | 
				
			||||||
 | 
					       "      <td>ran_vals</td>\n",
 | 
				
			||||||
 | 
					       "      <td>project_id</td>\n",
 | 
				
			||||||
 | 
					       "      <td>libevent_libevent</td>\n",
 | 
				
			||||||
 | 
					       "      <td>before_after:week_index</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.186522</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.478091</td>\n",
 | 
				
			||||||
 | 
					       "      <td>-0.750519</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.123563</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1</td>\n",
 | 
				
			||||||
 | 
					       "      <td>3229.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>1</th>\n",
 | 
				
			||||||
 | 
					       "      <td>zaach_jison_hullabaloo_README.md</td>\n",
 | 
				
			||||||
 | 
					       "      <td>44.78</td>\n",
 | 
				
			||||||
 | 
					       "      <td>13.5</td>\n",
 | 
				
			||||||
 | 
					       "      <td>7.714286</td>\n",
 | 
				
			||||||
 | 
					       "      <td>10.70</td>\n",
 | 
				
			||||||
 | 
					       "      <td>37.2</td>\n",
 | 
				
			||||||
 | 
					       "      <td>33.05</td>\n",
 | 
				
			||||||
 | 
					       "      <td>2250</td>\n",
 | 
				
			||||||
 | 
					       "      <td>395</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.000489</td>\n",
 | 
				
			||||||
 | 
					       "      <td>...</td>\n",
 | 
				
			||||||
 | 
					       "      <td>ran_vals</td>\n",
 | 
				
			||||||
 | 
					       "      <td>project_id</td>\n",
 | 
				
			||||||
 | 
					       "      <td>zaach_jison</td>\n",
 | 
				
			||||||
 | 
					       "      <td>before_after:week_index</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.001879</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.217063</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.576443</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.427315</td>\n",
 | 
				
			||||||
 | 
					       "      <td>2</td>\n",
 | 
				
			||||||
 | 
					       "      <td>4068.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>2</th>\n",
 | 
				
			||||||
 | 
					       "      <td>lincolnloop_python-qrcode.git_hullabaloo_READM...</td>\n",
 | 
				
			||||||
 | 
					       "      <td>58.28</td>\n",
 | 
				
			||||||
 | 
					       "      <td>8.4</td>\n",
 | 
				
			||||||
 | 
					       "      <td>7.583333</td>\n",
 | 
				
			||||||
 | 
					       "      <td>10.76</td>\n",
 | 
				
			||||||
 | 
					       "      <td>18.3</td>\n",
 | 
				
			||||||
 | 
					       "      <td>6.82</td>\n",
 | 
				
			||||||
 | 
					       "      <td>464</td>\n",
 | 
				
			||||||
 | 
					       "      <td>78</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.002597</td>\n",
 | 
				
			||||||
 | 
					       "      <td>...</td>\n",
 | 
				
			||||||
 | 
					       "      <td>ran_vals</td>\n",
 | 
				
			||||||
 | 
					       "      <td>project_id</td>\n",
 | 
				
			||||||
 | 
					       "      <td>lincolnloop_python-qrcode.git</td>\n",
 | 
				
			||||||
 | 
					       "      <td>before_after:week_index</td>\n",
 | 
				
			||||||
 | 
					       "      <td>-0.220654</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.679910</td>\n",
 | 
				
			||||||
 | 
					       "      <td>-1.553254</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.111946</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1467.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>3</th>\n",
 | 
				
			||||||
 | 
					       "      <td>mati75_evilwm.git_hullabaloo_README</td>\n",
 | 
				
			||||||
 | 
					       "      <td>66.74</td>\n",
 | 
				
			||||||
 | 
					       "      <td>7.2</td>\n",
 | 
				
			||||||
 | 
					       "      <td>5.888889</td>\n",
 | 
				
			||||||
 | 
					       "      <td>8.77</td>\n",
 | 
				
			||||||
 | 
					       "      <td>18.1</td>\n",
 | 
				
			||||||
 | 
					       "      <td>56.76</td>\n",
 | 
				
			||||||
 | 
					       "      <td>3864</td>\n",
 | 
				
			||||||
 | 
					       "      <td>742</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.000266</td>\n",
 | 
				
			||||||
 | 
					       "      <td>...</td>\n",
 | 
				
			||||||
 | 
					       "      <td>ran_vals</td>\n",
 | 
				
			||||||
 | 
					       "      <td>project_id</td>\n",
 | 
				
			||||||
 | 
					       "      <td>mati75_evilwm.git</td>\n",
 | 
				
			||||||
 | 
					       "      <td>before_after:week_index</td>\n",
 | 
				
			||||||
 | 
					       "      <td>-0.293846</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.697316</td>\n",
 | 
				
			||||||
 | 
					       "      <td>-1.660560</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.072868</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1184.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>4</th>\n",
 | 
				
			||||||
 | 
					       "      <td>markdown-it_markdown-it_hullabaloo_README.md</td>\n",
 | 
				
			||||||
 | 
					       "      <td>45.76</td>\n",
 | 
				
			||||||
 | 
					       "      <td>11.1</td>\n",
 | 
				
			||||||
 | 
					       "      <td>12.000000</td>\n",
 | 
				
			||||||
 | 
					       "      <td>12.84</td>\n",
 | 
				
			||||||
 | 
					       "      <td>24.0</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.51</td>\n",
 | 
				
			||||||
 | 
					       "      <td>103</td>\n",
 | 
				
			||||||
 | 
					       "      <td>17</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.006993</td>\n",
 | 
				
			||||||
 | 
					       "      <td>...</td>\n",
 | 
				
			||||||
 | 
					       "      <td>ran_vals</td>\n",
 | 
				
			||||||
 | 
					       "      <td>project_id</td>\n",
 | 
				
			||||||
 | 
					       "      <td>markdown-it_markdown-it</td>\n",
 | 
				
			||||||
 | 
					       "      <td>before_after:week_index</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.238615</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.602856</td>\n",
 | 
				
			||||||
 | 
					       "      <td>-0.942961</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1.420190</td>\n",
 | 
				
			||||||
 | 
					       "      <td>1</td>\n",
 | 
				
			||||||
 | 
					       "      <td>3459.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "  </tbody>\n",
 | 
				
			||||||
 | 
					       "</table>\n",
 | 
				
			||||||
 | 
					       "<p>5 rows × 33 columns</p>\n",
 | 
				
			||||||
 | 
					       "</div>"
 | 
				
			||||||
 | 
					      ],
 | 
				
			||||||
 | 
					      "text/plain": [
 | 
				
			||||||
 | 
					       "                                            filename  flesch_reading_ease  \\\n",
 | 
				
			||||||
 | 
					       "0                libevent_libevent_hullabaloo_README                50.36   \n",
 | 
				
			||||||
 | 
					       "1                   zaach_jison_hullabaloo_README.md                44.78   \n",
 | 
				
			||||||
 | 
					       "2  lincolnloop_python-qrcode.git_hullabaloo_READM...                58.28   \n",
 | 
				
			||||||
 | 
					       "3                mati75_evilwm.git_hullabaloo_README                66.74   \n",
 | 
				
			||||||
 | 
					       "4       markdown-it_markdown-it_hullabaloo_README.md                45.76   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "   flesch_kincaid_grade  linsear_write_formula  dale_chall_readability_score  \\\n",
 | 
				
			||||||
 | 
					       "0                  11.4              14.625000                         12.47   \n",
 | 
				
			||||||
 | 
					       "1                  13.5               7.714286                         10.70   \n",
 | 
				
			||||||
 | 
					       "2                   8.4               7.583333                         10.76   \n",
 | 
				
			||||||
 | 
					       "3                   7.2               5.888889                          8.77   \n",
 | 
				
			||||||
 | 
					       "4                  11.1              12.000000                         12.84   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "   mcalpine_eflaw  reading_time  char_count  word_count        t0  ...  \\\n",
 | 
				
			||||||
 | 
					       "0            26.3          7.37         502          83  0.001976  ...   \n",
 | 
				
			||||||
 | 
					       "1            37.2         33.05        2250         395  0.000489  ...   \n",
 | 
				
			||||||
 | 
					       "2            18.3          6.82         464          78  0.002597  ...   \n",
 | 
				
			||||||
 | 
					       "3            18.1         56.76        3864         742  0.000266  ...   \n",
 | 
				
			||||||
 | 
					       "4            24.0          1.51         103          17  0.006993  ...   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "     effect       group                          level  \\\n",
 | 
				
			||||||
 | 
					       "0  ran_vals  project_id              libevent_libevent   \n",
 | 
				
			||||||
 | 
					       "1  ran_vals  project_id                    zaach_jison   \n",
 | 
				
			||||||
 | 
					       "2  ran_vals  project_id  lincolnloop_python-qrcode.git   \n",
 | 
				
			||||||
 | 
					       "3  ran_vals  project_id              mati75_evilwm.git   \n",
 | 
				
			||||||
 | 
					       "4  ran_vals  project_id        markdown-it_markdown-it   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "                      term  estimate  std.error  conf.low  conf.high  \\\n",
 | 
				
			||||||
 | 
					       "0  before_after:week_index  0.186522   0.478091 -0.750519   1.123563   \n",
 | 
				
			||||||
 | 
					       "1  before_after:week_index  1.001879   0.217063  0.576443   1.427315   \n",
 | 
				
			||||||
 | 
					       "2  before_after:week_index -0.220654   0.679910 -1.553254   1.111946   \n",
 | 
				
			||||||
 | 
					       "3  before_after:week_index -0.293846   0.697316 -1.660560   1.072868   \n",
 | 
				
			||||||
 | 
					       "4  before_after:week_index  0.238615   0.602856 -0.942961   1.420190   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "   ranef_grouping    rank  \n",
 | 
				
			||||||
 | 
					       "0               1  3229.0  \n",
 | 
				
			||||||
 | 
					       "1               2  4068.0  \n",
 | 
				
			||||||
 | 
					       "2               1  1467.0  \n",
 | 
				
			||||||
 | 
					       "3               1  1184.0  \n",
 | 
				
			||||||
 | 
					       "4               1  3459.0  \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "[5 rows x 33 columns]"
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					     },
 | 
				
			||||||
 | 
					     "execution_count": 4,
 | 
				
			||||||
 | 
					     "metadata": {},
 | 
				
			||||||
 | 
					     "output_type": "execute_result"
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					   ],
 | 
				
			||||||
 | 
					   "source": [
 | 
				
			||||||
 | 
					    "second_merge.head()"
 | 
				
			||||||
 | 
					   ]
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					   "cell_type": "code",
 | 
				
			||||||
 | 
					   "execution_count": null,
 | 
				
			||||||
 | 
					   "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>1</th>\n",
 | 
				
			||||||
 | 
					       "      <td>55.137558</td>\n",
 | 
				
			||||||
 | 
					       "      <td>52.935</td>\n",
 | 
				
			||||||
 | 
					       "      <td>23.486399</td>\n",
 | 
				
			||||||
 | 
					       "      <td>9.29</td>\n",
 | 
				
			||||||
 | 
					       "      <td>256.988900</td>\n",
 | 
				
			||||||
 | 
					       "      <td>90.0</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>2</th>\n",
 | 
				
			||||||
 | 
					       "      <td>46.425909</td>\n",
 | 
				
			||||||
 | 
					       "      <td>51.365</td>\n",
 | 
				
			||||||
 | 
					       "      <td>22.760642</td>\n",
 | 
				
			||||||
 | 
					       "      <td>9.53</td>\n",
 | 
				
			||||||
 | 
					       "      <td>249.534759</td>\n",
 | 
				
			||||||
 | 
					       "      <td>100.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",
 | 
				
			||||||
 | 
					       "1                        55.137558  52.935    23.486399   9.29  256.988900   \n",
 | 
				
			||||||
 | 
					       "2                        46.425909  51.365    22.760642   9.53  249.534759   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "                       \n",
 | 
				
			||||||
 | 
					       "               median  \n",
 | 
				
			||||||
 | 
					       "ranef_grouping         \n",
 | 
				
			||||||
 | 
					       "1                90.0  \n",
 | 
				
			||||||
 | 
					       "2               100.0  "
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					     },
 | 
				
			||||||
 | 
					     "execution_count": 7,
 | 
				
			||||||
 | 
					     "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": 10,
 | 
				
			||||||
 | 
					   "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",
 | 
				
			||||||
 | 
					       "      <th>t5</th>\n",
 | 
				
			||||||
 | 
					       "      <th>t6</th>\n",
 | 
				
			||||||
 | 
					       "      <th>t7</th>\n",
 | 
				
			||||||
 | 
					       "      <th>t8</th>\n",
 | 
				
			||||||
 | 
					       "      <th>t9</th>\n",
 | 
				
			||||||
 | 
					       "      <th>t10</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",
 | 
				
			||||||
 | 
					       "      <th>mean</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",
 | 
				
			||||||
 | 
					       "      <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>1</th>\n",
 | 
				
			||||||
 | 
					       "      <td>0.035938</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.082578</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.096817</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.156525</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.111305</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.094973</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.068736</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.11493</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.061243</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.097605</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.079349</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "    <tr>\n",
 | 
				
			||||||
 | 
					       "      <th>2</th>\n",
 | 
				
			||||||
 | 
					       "      <td>0.024329</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.053934</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.095806</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.209661</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.101464</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.076628</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.082048</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.15226</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.064241</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.088526</td>\n",
 | 
				
			||||||
 | 
					       "      <td>0.051103</td>\n",
 | 
				
			||||||
 | 
					       "    </tr>\n",
 | 
				
			||||||
 | 
					       "  </tbody>\n",
 | 
				
			||||||
 | 
					       "</table>\n",
 | 
				
			||||||
 | 
					       "</div>"
 | 
				
			||||||
 | 
					      ],
 | 
				
			||||||
 | 
					      "text/plain": [
 | 
				
			||||||
 | 
					       "                      t0        t1        t2        t3        t4        t5  \\\n",
 | 
				
			||||||
 | 
					       "                    mean      mean      mean      mean      mean      mean   \n",
 | 
				
			||||||
 | 
					       "ranef_grouping                                                               \n",
 | 
				
			||||||
 | 
					       "1               0.035938  0.082578  0.096817  0.156525  0.111305  0.094973   \n",
 | 
				
			||||||
 | 
					       "2               0.024329  0.053934  0.095806  0.209661  0.101464  0.076628   \n",
 | 
				
			||||||
 | 
					       "\n",
 | 
				
			||||||
 | 
					       "                      t6       t7        t8        t9       t10  \n",
 | 
				
			||||||
 | 
					       "                    mean     mean      mean      mean      mean  \n",
 | 
				
			||||||
 | 
					       "ranef_grouping                                                   \n",
 | 
				
			||||||
 | 
					       "1               0.068736  0.11493  0.061243  0.097605  0.079349  \n",
 | 
				
			||||||
 | 
					       "2               0.082048  0.15226  0.064241  0.088526  0.051103  "
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					     },
 | 
				
			||||||
 | 
					     "execution_count": 10,
 | 
				
			||||||
 | 
					     "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",
 | 
				
			||||||
 | 
					    "    't5' : ['mean'],\n",
 | 
				
			||||||
 | 
					    "    't6' : ['mean'],\n",
 | 
				
			||||||
 | 
					    "    't7' : ['mean'],\n",
 | 
				
			||||||
 | 
					    "    't8' : ['mean'],\n",
 | 
				
			||||||
 | 
					    "    't9' : ['mean'],\n",
 | 
				
			||||||
 | 
					    "    't10': ['mean']\n",
 | 
				
			||||||
 | 
					    "})\n",
 | 
				
			||||||
 | 
					    "\n",
 | 
				
			||||||
 | 
					    "topic_aggregate"
 | 
				
			||||||
 | 
					   ]
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 ],
 | 
					 ],
 | 
				
			||||||
 "metadata": {
 | 
					 "metadata": {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user