From 58c3ee77758892eac9f36c865090d97c0a2886a5 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Fri, 31 Jan 2020 01:47:09 +1100 Subject: [PATCH] finished some jrnl analysis, not sure what more to do other than NLP stuff maybe --- README.md | 2 +- notebook.ipynb | 165 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 161 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2fee0f9..3edc24d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ data from: * Web browser * Loop Habits -* * Nextcloud backup +* * Nextcloud backup -> rename 'Date' to 'date' * Taskwarrior * * Run 'task export' * Wallabag diff --git a/notebook.ipynb b/notebook.ipynb index fd047b8..3c014ec 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -17,6 +17,151 @@ " return df.filter(like='2019', axis=0)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Shaarli" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Journal" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### make a journal_fixer script \n", + "\n", + "### import journal into habits data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "According to habits I have 49 Journal entries\n", + "\n", + "\n", + "Let's compare that with this data" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [], + "source": [ + "import json" + ] + }, + { + "cell_type": "code", + "execution_count": 106, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tags 87\n", + "text 88\n", + "title 88\n", + "dtype: int64" + ] + }, + "execution_count": 106, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "with open('data/tiddlers.json' , 'r') as file:\n", + " tiddly = json.load(file)\n", + "\n", + "jrnl = pd.DataFrame.from_dict(tiddly)\n", + "jrnl.set_axis(jrnl['title'], axis='index', inplace=True)\n", + "jrnl = only2019(jrnl.drop(['created', 'modified'], axis=1))\n", + "jrnl.count()" + ] + }, + { + "cell_type": "code", + "execution_count": 107, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tags 30\n", + "text 30\n", + "title 30\n", + "dtype: int64" + ] + }, + "execution_count": 107, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sameDay = jrnl\n", + "sameDay['title'] = sameDay.title.map(lambda x: x[:-8])\n", + "sameDay[sameDay['title'].duplicated(keep=False)].count()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Where are the [87-15=(73)] - 49 = 23 entries that exist but aren't in my loop Habits?\n", + "\n", + "23 Entries before March?" + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "metadata": {}, + "outputs": [], + "source": [ + "def beforeMarch(df):\n", + " return df.filter(regex='(January|Febuary|March)', axis=0)" + ] + }, + { + "cell_type": "code", + "execution_count": 121, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "tags 23\n", + "text 23\n", + "title 23\n", + "dtype: int64" + ] + }, + "execution_count": 121, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "beforeMarch(jrnl).count()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -185,6 +330,16 @@ " print(\" \" + e)" ] }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [], + "source": [ + "# Most described task?\n", + "## TODO" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -194,7 +349,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 100, "metadata": {}, "outputs": [], "source": [ @@ -206,7 +361,7 @@ }, { "cell_type": "code", - "execution_count": 183, + "execution_count": 105, "metadata": {}, "outputs": [ { @@ -404,14 +559,14 @@ "12 0.387097 0.548387 1.096774 0.709677 0.612903 0.000000 0.612903" ] }, - "execution_count": 183, + "execution_count": 105, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#colNames = ['date', 'Godmode', 'Meditate', 'Exercise', 'Piano','Read', 'Journal', 'Gratitude', 'devlog','Plants', 'Job', 'Draw']\n", - "checks = pd.read_csv('LoopHabits/Checkmarks.csv', header=0)\n", + "checks = pd.read_csv('data/LoopHabits/Checkmarks.csv', header=0)\n", "checks.set_axis(checks['date'], axis='index', inplace=True)\n", "checks = checks.drop(['Godmode', 'Piano', 'Gratitude', 'Job', 'date'], axis=1)\n", "df = MarchOnwards(only2019(checks))\n", @@ -429,7 +584,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 102, "metadata": {}, "outputs": [], "source": [