Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
staeiou committed Sep 9, 2017
1 parent 84986f3 commit dd2667a
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion analysis/main/5-1-prop-bot-reverts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import datasets\n",
"Using a dictionary of pandas dataframes, with the key as the language. A better way would be to have a tidy dataframe."
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down Expand Up @@ -345,19 +353,36 @@
"df_rev_dict['en'][0:5]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Clean and combine the two datasets"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 21,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def truncate_my(s):\n",
" \"\"\"\n",
" Truncate YYYYMMDD format to YYYYMM. For use with df.apply()\n",
" \"\"\"\n",
" s = str(s)\n",
" return int(s[0:6])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Test function"
]
},
{
"cell_type": "code",
"execution_count": 12,
Expand All @@ -378,6 +403,15 @@
"truncate_my(20100101)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 13,
Expand Down

0 comments on commit dd2667a

Please # to comment.