X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/5aa81a0ebcb6ea28bd78d22a23e6522c2dbc5713..c82c792785d173c9c492e54518ae26a4d387f846:/data/issues.ipynb diff --git a/data/issues.ipynb b/data/issues.ipynb index b65e1d7..d718bbf 100644 --- a/data/issues.ipynb +++ b/data/issues.ipynb @@ -4,42 +4,84 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "import platform\n", + "import matplotlib.pyplot as plt\n", "print(platform.python_version())" ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "# Get ye data\n", - "import glob\n", - "import os\n", + "# Todo List\n", "\n", - "data_files = glob.glob(os.path.expanduser('~\\\\Data\\\\*.json'))\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" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ + "# Get ye data\n", + "import glob\n", "import os\n", "\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" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "import pandas as pd\n", "\n", @@ -57,7 +99,18 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "import numpy as np\n", "df['count'] = np.zeros(len(df))\n", @@ -75,18 +128,65 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ + "\n", "dfp = df\n", - "dfp['mile'] = [d.get('title') if d else None for d in dfp.milestone]\n", - "dfp.drop(columns=['closedAt','milestone', 'url'], inplace=True)" + "# 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": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], + "source": [ + "closed_dates = pd.to_datetime(df['closedAt'], format='ISO8601')\n", + "dfp['year'] = closed_dates.dt.year\n", + "\n", + "dfp.drop(columns=['closedAt','milestone', 'url'], inplace=True)\n", + "print(dfp)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "\n", "mile_counts = dfp.groupby('mile')['title'].nunique()\n", @@ -102,16 +202,70 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "mile_counts = df.groupby('mile')['count'].sum()\n", "mile_counts = mile_counts.loc[lambda x: x > 5]\n", - "plt.pie(mile_counts, labels=mile_counts.index, autopct='%1.1f%%')\n", + "\n", + "\n", + "print(mile_counts)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], + "source": [ + "\n", + "plt.pie(mile_counts, labels=mile_counts.index, autopct='%0.1f%%')\n", "plt.title(f\"Tasks by Milestone\")\n", "plt.axis('equal')\n", "plt.show()" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], + "source": [ + "type(mile_counts)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -123,7 +277,18 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "closed_months = pd.to_datetime(df['closedAt'], format='ISO8601')\n", "df['closed_month'] = closed_months.dt.month\n", @@ -134,7 +299,18 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "df['mile'] = [d.get('title') if d else None for d in df.milestone]" ] @@ -143,7 +319,18 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "\n", "dfg = df.groupby(['mile', 'closed_month']).count().reset_index()\n", @@ -154,7 +341,18 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "exclude_from_chart = [\n", "\t'Job Aid Ideas']\n", @@ -167,7 +365,18 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with '/bin/python3' requires the ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '/bin/python3 -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", @@ -208,7 +417,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.2" + "version": "3.8.10" } }, "nbformat": 4,