Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

part 7th finished #1383

Open
wants to merge 1 commit into
base: group_10_ass_3_2024_2
Choose a base branch
from
Open
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
24 changes: 22 additions & 2 deletions Lecture_3/Assignment_3/group_10_ass_3_2024_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,27 @@
"metadata": {},
"outputs": [],
"source": [
"###"
"### this code does not consider the previous not existent yet code, but tryes to follow the rute of the assignment\n",
"\n",
" #using a list to colect dataframes\n",
"all_dfs = []\n",
"for year_str, data in all_data.items():\n",
" rec1_df = data['rec_1']\n",
" rec2_df = data['rec_2']\n",
" rec3_df = data['rec_3']\n",
" \n",
" # Select and merge columns\n",
" rec1_df = rec1_df[columns_rec1]\n",
" rec2_df = rec2_df[columns_rec2]\n",
" rec3_df = rec3_df[columns_rec3]\n",
" \n",
" rec1_df['year'] = int(year_str.split('_')[1])\n",
" \n",
" merged_df = rec1_df.merge(rec2_df, on='CASEID').merge(rec3_df, on='CASEID')\n",
" all_dfs.append(merged_df)\n",
"\n",
"# Concatenate all data re indexing\n",
"endes_data_2015_2019 = pd.concat(all_dfs).reset_index(drop=True)"
]
},
{
Expand Down Expand Up @@ -412,7 +432,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down