5 "execution_count": null,
11 "output_type": "error",
13 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
14 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
15 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
21 "import matplotlib.pyplot as plt\n",
22 "print(platform.python_version())"
26 "cell_type": "markdown",
31 "cell_type": "markdown",
36 "- [x] add calculated year to the metadata\n",
37 "- [ ] make one chart per year\n",
38 "- [x] make sure all the data files are getting loaded"
43 "execution_count": null,
49 "output_type": "error",
51 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
52 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
53 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
62 "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))\n",
64 "for file in data_files:\n",
65 "\tprint(f\"{file}\", os.path.getsize(file))\n",
71 "execution_count": null,
77 "output_type": "error",
79 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
80 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
81 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
86 "import pandas as pd\n",
89 "for file in data_files:\n",
91 "\tf = open(file, encoding='utf-8')\n",
92 "\tdf_temp = pd.read_json(f)\n",
93 "\tdata_frames.append(df_temp)\n",
95 "df = pd.concat(data_frames, ignore_index=True)"
100 "execution_count": null,
106 "output_type": "error",
108 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
109 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
110 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
115 "import numpy as np\n",
116 "df['count'] = np.zeros(len(df))\n",
121 "cell_type": "markdown",
129 "execution_count": null,
135 "output_type": "error",
137 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
138 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
139 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
146 "# dfp['mile'] = [m.get('title') if m else None for m in dfp.milestone]\n",
147 "dfp['mile'] = [m.get('title') if hasattr(m, 'get') else None for m in dfp['milestone']]\n"
152 "execution_count": null,
158 "output_type": "error",
160 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
161 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
162 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
167 "closed_dates = pd.to_datetime(df['closedAt'], format='ISO8601')\n",
168 "dfp['year'] = closed_dates.dt.year\n",
170 "dfp.drop(columns=['closedAt','milestone', 'url'], inplace=True)\n",
176 "execution_count": null,
182 "output_type": "error",
184 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
185 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
186 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
192 "mile_counts = dfp.groupby('mile')['title'].nunique()\n",
193 "dfp['count'] = dfp['mile'].map(mile_counts)\n",
194 "# dfp.drop(columns=['title'], inplace=True)\n",
195 "dfp['mile'] = df['mile'].drop_duplicates()\n",
196 "dfp.dropna(inplace=True)\n",
197 "dfp = dfp[dfp['count'] > 5]\n",
203 "execution_count": null,
209 "output_type": "error",
211 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
212 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
213 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
218 "mile_counts = df.groupby('mile')['count'].sum()\n",
219 "mile_counts = mile_counts.loc[lambda x: x > 5]\n",
227 "execution_count": null,
233 "output_type": "error",
235 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
236 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
237 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
243 "plt.pie(mile_counts, labels=mile_counts.index, autopct='%0.1f%%')\n",
244 "plt.title(f\"Tasks by Milestone\")\n",
245 "plt.axis('equal')\n",
251 "execution_count": null,
257 "output_type": "error",
259 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
260 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
261 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
270 "cell_type": "markdown",
273 "#### Plot of closed issues by month and milestone for one project\n"
278 "execution_count": null,
284 "output_type": "error",
286 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
287 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
288 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
293 "closed_months = pd.to_datetime(df['closedAt'], format='ISO8601')\n",
294 "df['closed_month'] = closed_months.dt.month\n",
295 "df.drop(columns=['closedAt'], inplace=True)"
300 "execution_count": null,
306 "output_type": "error",
308 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
309 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
310 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
315 "df['mile'] = [d.get('title') if d else None for d in df.milestone]"
320 "execution_count": null,
326 "output_type": "error",
328 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
329 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
330 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
336 "dfg = df.groupby(['mile', 'closed_month']).count().reset_index()\n",
337 "dfg.drop(columns=['milestone', 'title', 'url'], inplace=True)\n"
342 "execution_count": null,
348 "output_type": "error",
350 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
351 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
352 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
357 "exclude_from_chart = [\n",
358 "\t'Job Aid Ideas']\n",
360 "for ex in exclude_from_chart:\n",
361 "\tdfg = dfg[dfg['mile'] != ex]\n"
366 "execution_count": null,
372 "output_type": "error",
374 "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n",
375 "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
376 "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
381 "import seaborn as sns\n",
382 "import matplotlib.pyplot as plt\n",
388 "execution_count": null,
392 "plt.figure(figsize=(10, 6))\n",
393 "sns.pie(x='closed_month', y='count', hue='mile', data=dfg)\n",
395 "plt.xlabel('Closed Month')\n",
396 "plt.ylabel('ClosedAt')\n",
397 "plt.title('Stacked Line Chart: Milestone Effort by Issue Close Date')\n",
398 "plt.xticks(rotation=45)\n",
399 "plt.legend(title='Mile', loc='upper left')\n",
406 "display_name": "Python 3",
407 "language": "python",
415 "file_extension": ".py",
416 "mimetype": "text/x-python",
418 "nbconvert_exporter": "python",
419 "pygments_lexer": "ipython3",