Skip to content

Commit 8209dd5

Browse files
authored
Merge pull request #130 from gperdrizet/dev
Updated output saving in activity notebook
2 parents ca2cacc + a38004e commit 8209dd5

File tree

3 files changed

+41289
-1
lines changed

3 files changed

+41289
-1
lines changed

notebooks/unit2/lesson_16/Lesson_16_activity.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
"metadata": {},
2828
"outputs": [],
2929
"source": [
30+
"from pathlib import Path\n",
31+
"\n",
3032
"import pandas as pd\n",
3133
"import numpy as np\n",
3234
"import matplotlib.pyplot as plt\n",
@@ -172,8 +174,12 @@
172174
"metadata": {},
173175
"outputs": [],
174176
"source": [
177+
"# Create output directory if it doesn't exist\n",
178+
"output_directory = 'data/outputs'\n",
179+
"Path(output_directory).mkdir(parents=True, exist_ok=True)\n",
180+
"\n",
175181
"# Save a copy of the engineered dataframe\n",
176-
"housing_df.to_csv('housing_df.csv', index=False)"
182+
"housing_df.to_csv('data/outputs/housing_df.csv', index=False)"
177183
]
178184
},
179185
{

0 commit comments

Comments
 (0)