X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/blobdiff_plain/ea3abfdad5df78e020429d07e6e476b1cb1317e8..a910c69f72750663d75dd347c3943ee0a0424bdf:/data/issues.ipynb diff --git a/data/issues.ipynb b/data/issues.ipynb index 7b7f1be..08d596b 100644 --- a/data/issues.ipynb +++ b/data/issues.ipynb @@ -11,13 +11,18 @@ "print(platform.python_version())" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Todo List\n", "\n", - "- [ ] trim each chart to just a single, selected year\n", + "- [x] add calculated year to the metadata\n", "- [ ] make one chart per year\n", "- [x] make sure all the data files are getting loaded" ] @@ -32,19 +37,11 @@ "import glob\n", "import os\n", "\n", - "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", + "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))\n", "\n", "for file in data_files:\n", - "\tprint(f\"{file}\", os.path.getsize(file))\n" + "\tprint(f\"{file}\", os.path.getsize(file))\n", + "\n" ] }, { @@ -89,12 +86,21 @@ "metadata": {}, "outputs": [], "source": [ + "\n", "dfp = df\n", - "dfp['mile'] = [d.get('title') if d else None for d in dfp.milestone]\n", + "# dfp['mile'] = [m.get('title') if m else None for m in dfp.milestone]\n", + "dfp['mile'] = [m.get('title') if hasattr(m, 'get') else None for m in dfp['milestone']]\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "closed_dates = pd.to_datetime(df['closedAt'], format='ISO8601')\n", "dfp['year'] = closed_dates.dt.year\n", "\n", - "# TODO: Split by YEAR before dropping 'closedAt'\n", "dfp.drop(columns=['closedAt','milestone', 'url'], inplace=True)\n", "print(dfp)" ]