Skip to content

Commit

Permalink
Restructure the flask app
Browse files Browse the repository at this point in the history
  • Loading branch information
iamirmasoud committed Jun 18, 2022
1 parent 92d861a commit 7063477
Show file tree
Hide file tree
Showing 18 changed files with 2,197 additions and 6,222 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@ dmypy.json
# Pyre type checker
.pyre/
.idea/
debug_script.py
debug_script.py
app/models/
11 changes: 5 additions & 6 deletions 1_ETL Pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
],
"source": [
"# load messages dataset\n",
"messages = pd.read_csv(\"data/disaster_messages.csv\")\n",
"messages = pd.read_csv(\"./app/data/disaster_messages.csv\")\n",
"messages.head()"
]
},
Expand Down Expand Up @@ -194,7 +194,7 @@
],
"source": [
"# load categories dataset\n",
"categories = pd.read_csv(\"data/disaster_categories.csv\")\n",
"categories = pd.read_csv(\"./app/data/disaster_categories.csv\")\n",
"categories.head()"
]
},
Expand Down Expand Up @@ -1063,8 +1063,7 @@
"source": [
"for column in categories:\n",
" # set each value to be the last character of the string\n",
" categories[column] = categories[column].apply(\n",
" lambda x: int(x.split(\"-\")[1]))\n",
" categories[column] = categories[column].apply(lambda x: int(x.split(\"-\")[1]))\n",
"\n",
"categories.head()"
]
Expand Down Expand Up @@ -1475,11 +1474,11 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"engine = create_engine(\"sqlite:///data/DisasterResponse.db\")\n",
"engine = create_engine(\"sqlite:///app/data/DisasterResponse.db\")\n",
"df.to_sql(\"DisasterResponse\", engine, index=False, if_exists=\"replace\")"
]
},
Expand Down
Loading

0 comments on commit 7063477

Please sign in to comment.