Skip to content

Commit

Permalink
data visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
RistovaIvona committed Jul 26, 2020
1 parent 16f5202 commit fc01a98
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions DataVisualization/DataVisualization_update.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,28 @@
"count_age_y = count_age_y.transpose()"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [],
"source": [
"lst = [data]\n",
"for column in lst:\n",
" column.loc[column[\"month\"] == \"jan\", \"month_int\"] = 1\n",
" column.loc[column[\"month\"] == \"feb\", \"month_int\"] = 2\n",
" column.loc[column[\"month\"] == \"mar\", \"month_int\"] = 3\n",
" column.loc[column[\"month\"] == \"apr\", \"month_int\"] = 4\n",
" column.loc[column[\"month\"] == \"may\", \"month_int\"] = 5\n",
" column.loc[column[\"month\"] == \"jun\", \"month_int\"] = 6\n",
" column.loc[column[\"month\"] == \"jul\", \"month_int\"] = 7\n",
" column.loc[column[\"month\"] == \"aug\", \"month_int\"] = 8\n",
" column.loc[column[\"month\"] == \"sep\", \"month_int\"] = 9\n",
" column.loc[column[\"month\"] == \"oct\", \"month_int\"] = 10\n",
" column.loc[column[\"month\"] == \"nov\", \"month_int\"] = 11\n",
" column.loc[column[\"month\"] == \"dec\", \"month_int\"] = 12"
]
},
{
"cell_type": "code",
"execution_count": 57,
Expand Down Expand Up @@ -4175,28 +4197,6 @@
" column.loc[column[\"age\"] >= 60, 'age_group'] = 60"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [],
"source": [
"lst = [data]\n",
"for column in lst:\n",
" column.loc[column[\"month\"] == \"jan\", \"month_int\"] = 1\n",
" column.loc[column[\"month\"] == \"feb\", \"month_int\"] = 2\n",
" column.loc[column[\"month\"] == \"mar\", \"month_int\"] = 3\n",
" column.loc[column[\"month\"] == \"apr\", \"month_int\"] = 4\n",
" column.loc[column[\"month\"] == \"may\", \"month_int\"] = 5\n",
" column.loc[column[\"month\"] == \"jun\", \"month_int\"] = 6\n",
" column.loc[column[\"month\"] == \"jul\", \"month_int\"] = 7\n",
" column.loc[column[\"month\"] == \"aug\", \"month_int\"] = 8\n",
" column.loc[column[\"month\"] == \"sep\", \"month_int\"] = 9\n",
" column.loc[column[\"month\"] == \"oct\", \"month_int\"] = 10\n",
" column.loc[column[\"month\"] == \"nov\", \"month_int\"] = 11\n",
" column.loc[column[\"month\"] == \"dec\", \"month_int\"] = 12"
]
},
{
"cell_type": "code",
"execution_count": 61,
Expand Down

0 comments on commit fc01a98

Please sign in to comment.