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 "grp_df = df.groupby(['mile', 'closed_month']).count().reset_index()\n",
94 "grp_df.drop(columns=['milestone', 'title', 'url'], inplace=True)"
99 "execution_count": null,
108 "cell_type": "markdown",
111 "#### Plot of closed issues by month and milestone for one project\n"
116 "execution_count": null,
120 "import seaborn as sns\n",
121 "import matplotlib.pyplot as plt\n",
127 "execution_count": null,
131 "plt.figure(figsize=(10, 6))\n",
132 "sns.barplot(x='closed_month', y='url', hue='mile', data=grp_df)\n",
133 "plt.xlabel('Closed Month')\n",
134 "plt.ylabel('ClosedAt')\n",
135 "plt.title('Stacked Line Chart: Milestone Effort by Issue Close Date')\n",
136 "plt.xticks(rotation=45)\n",
137 "plt.legend(title='Mile', loc='upper left')\n",
144 "display_name": "Python 3",
145 "language": "python",
153 "file_extension": ".py",
154 "mimetype": "text/x-python",
156 "nbconvert_exporter": "python",
157 "pygments_lexer": "ipython3",