5 "execution_count": null,
10 "print(platform.python_version())"
15 "execution_count": null,
23 "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))\n"
28 "execution_count": null,
34 "for file in data_files:\n",
35 "\tprint(f\"{file}\", os.path.getsize(file))\n"
40 "execution_count": null,
44 "import pandas as pd\n",
48 "file = data_files[2]\n",
51 "f = open(file, encoding='utf-8')\n",
52 "df = pd.read_json(f)"
57 "execution_count": null,
61 "import numpy as np\n",
62 "df['count'] = np.zeros(len(df))\n",
68 "execution_count": null,
72 "closed_months = pd.to_datetime(df['closedAt'], format='ISO8601')\n",
73 "df['closed_month'] = closed_months.dt.month\n",
74 "df.drop(columns=['closedAt'], inplace=True)"
79 "execution_count": null,
83 "df['mile'] = [d.get('title') if d else None for d in df.milestone]"
88 "execution_count": null,
93 "dfg = df.groupby(['mile', 'closed_month']).count().reset_index()\n",
94 "dfg.drop(columns=['milestone', 'title', 'url'], inplace=True)\n"
99 "execution_count": null,
108 "cell_type": "markdown",
111 "#### Plot of closed issues by month and milestone for one project\n"
116 "execution_count": 32,
120 "exclude_from_chart = [\n",
121 "\t'Job Aid Ideas']\n",
123 "for ex in exclude_from_chart:\n",
124 "\tdfg = dfg[dfg['mile'] != ex]\n"
129 "execution_count": null,
133 "import seaborn as sns\n",
134 "import matplotlib.pyplot as plt\n",
140 "execution_count": null,
144 "plt.figure(figsize=(10, 6))\n",
145 "sns.barplot(x='closed_month', y='count', hue='mile', data=dfg)\n",
146 "plt.xlabel('Closed Month')\n",
147 "plt.ylabel('ClosedAt')\n",
148 "plt.title('Stacked Line Chart: Milestone Effort by Issue Close Date')\n",
149 "plt.xticks(rotation=45)\n",
150 "plt.legend(title='Mile', loc='upper left')\n",
157 "display_name": "Python 3",
158 "language": "python",
166 "file_extension": ".py",
167 "mimetype": "text/x-python",
169 "nbconvert_exporter": "python",
170 "pygments_lexer": "ipython3",