Skip to content

Commit

Permalink
Fix update informative table and reestructure the tracking file.
Browse files Browse the repository at this point in the history
  • Loading branch information
victorc365 committed Oct 5, 2023
1 parent b9a6f91 commit b61923f
Show file tree
Hide file tree
Showing 5 changed files with 38,394 additions and 54 deletions.
12 changes: 6 additions & 6 deletions src/main_generator_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -48,15 +48,15 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 14,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "616b97a348c4453b98510571c4e76dfd",
"model_id": "3b95936354a245759c69cd0157ff7791",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -70,7 +70,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "050183e7d30048b9b8da132e6a8ece79",
"model_id": "6e14e93ab57c4fb784c6d42cd58bbfc2",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -84,7 +84,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6719bc30717e4d61bddb517b7246a4a8",
"model_id": "25c5c668597341fab5b2b99c3580d516",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -98,7 +98,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1dce8241b23944978988de10534a1ca2",
"model_id": "ba12d221cef04e2cbabf48cd81d6ee6a",
"version_major": 2,
"version_minor": 0
},
Expand Down
129 changes: 121 additions & 8 deletions src/meals_collection/Process_recipes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13823,7 +13823,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -13832,7 +13832,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 29,
"metadata": {},
"outputs": [
{
Expand All @@ -13841,7 +13841,7 @@
"'/home/victor/Documents/Expectation_data_generation/src/meals_collection'"
]
},
"execution_count": 20,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -13852,21 +13852,134 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
"raw_data = pd.read_csv('/home/victor/Documents/Expectation_data_generation/src/recipes/raw_recipes.csv', \n",
" sep='|', index_col=0)"
"processed_data = pd.read_csv('/home/victor/Documents/Expectation_data_generation/src/recipes/processed_recipes_dataset.csv', \n",
" sep='|')"
]
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": [
"raw_data.reset_index(inplace=True)"
"processed_data[\"recipeId\"] = [f\"food_{i}\" for i in range(len(processed_data))]"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>title</th>\n",
" <th>raw_text</th>\n",
" <th>meal_type</th>\n",
" <th>cultural_restriction</th>\n",
" <th>calories</th>\n",
" <th>allergies</th>\n",
" <th>recipeId</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Fruit Salad</td>\n",
" <td>1. Fruit Salad: 70 calories per portion, 4 por...</td>\n",
" <td>breakfast</td>\n",
" <td>vegan</td>\n",
" <td>70.0</td>\n",
" <td>contains fruits only</td>\n",
" <td>food_0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Vegan Pancakes</td>\n",
" <td>2. Vegan Pancakes: 150 calories per portion, 4...</td>\n",
" <td>breakfast</td>\n",
" <td>vegan</td>\n",
" <td>150.0</td>\n",
" <td>NaN</td>\n",
" <td>food_1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Overnight Chia Pudding</td>\n",
" <td>3. Overnight Chia Pudding: 200 calories per po...</td>\n",
" <td>breakfast</td>\n",
" <td>vegan</td>\n",
" <td>200.0</td>\n",
" <td>contains nuts (almonds)</td>\n",
" <td>food_2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Avocado Toast</td>\n",
" <td>4. Avocado Toast: 250 calories per portion, 2 ...</td>\n",
" <td>breakfast</td>\n",
" <td>vegan</td>\n",
" <td>250.0</td>\n",
" <td>NaN</td>\n",
" <td>food_3</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" title raw_text \\\n",
"0 Fruit Salad 1. Fruit Salad: 70 calories per portion, 4 por... \n",
"1 Vegan Pancakes 2. Vegan Pancakes: 150 calories per portion, 4... \n",
"2 Overnight Chia Pudding 3. Overnight Chia Pudding: 200 calories per po... \n",
"3 Avocado Toast 4. Avocado Toast: 250 calories per portion, 2 ... \n",
"\n",
" meal_type cultural_restriction calories allergies recipeId \n",
"0 breakfast vegan 70.0 contains fruits only food_0 \n",
"1 breakfast vegan 150.0 NaN food_1 \n",
"2 breakfast vegan 200.0 contains nuts (almonds) food_2 \n",
"3 breakfast vegan 250.0 NaN food_3 "
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"processed_data.head(4)"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
"processed_data.to_csv('/home/victor/Documents/Expectation_data_generation/src/recipes/processed_recipes_dataset_id.csv',\n",
" sep='|')"
]
}
],
Expand Down
Loading

0 comments on commit b61923f

Please sign in to comment.