Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
807 changes: 807 additions & 0 deletions your-project/.ipynb_checkpoints/Data cleaning-checkpoint.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

File renamed without changes.
63 changes: 63 additions & 0 deletions your-project/Notes on project 5.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"## how to iterate through two lits two replace values from one list with the ones in the other.\n",
"\"\"\"\n",
"1st way:\n",
"for n in sharks[\"Date\"]:\n",
" try:\n",
" datetime_object = datetime.datetime.strptime(n, \"%m\")\n",
" month_name = datetime_object.strftime(\"%b\")\n",
" print(n, month_name)\n",
" except:\n",
" pass\n",
"\n",
"2 way: \n",
"sharks[\"Date\"].replace({1:\"Jan\", 2:\"Feb\"})\n",
"\n",
"\n",
"3 way\n",
"months=[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n",
"for m in months:\n",
" for n in sharks[\"Date\"]:\n",
" sharks[\"Date\"] = sharks[\"Date\"].replace(n,m)\n",
" \n",
"4 way\n",
"\n",
"months=[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n",
"\n",
"\n",
"for i in range(12):\n",
" sharks[sharks[\"Date\"] == str(i)] = months[i-1]\n",
"\n",
"\"\"\" "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Binary file added your-project/Report project 5.docx
Binary file not shown.
Loading