Skip to content

Commit d18c812

Browse files
committed
updates the data preparation data
edit was done by Wuor Bhang
1 parent 300f1fa commit d18c812

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

2_data_preparation/cleaning_teds_d.ipynb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": null,
23+
"execution_count": 31,
2424
"id": "596bf3e0",
2525
"metadata": {},
2626
"outputs": [],
@@ -29,6 +29,8 @@
2929
"import numpy as np\n",
3030
"from tqdm import tqdm\n",
3131
"import warnings\n",
32+
"import os\n",
33+
"os.getcwd()\n",
3234
"\n",
3335
"warnings.filterwarnings(\"ignore\")"
3436
]
@@ -876,15 +878,18 @@
876878
{
877879
"cell_type": "code",
878880
"execution_count": null,
879-
"id": "9ba487dc",
881+
"id": "dfbecb3a",
880882
"metadata": {},
881883
"outputs": [],
882884
"source": [
885+
"from pathlib import Path\n",
886+
"import os\n",
887+
"\n",
883888
"if __name__ == \"__main__\":\n",
884889
" INPUT_FILE = \"1_datasets/raw/tedsd_puf_2023.csv\"\n",
885890
" OUTPUT_FILE = \"1_datasets/processed/teds_d_2023_cleaned.csv\"\n",
886891
"\n",
887-
" clean_teds_d_data(INPUT_FILE, OUTPUT_FILE)"
892+
" clean_teds_d_data(INPUT_FILE, OUTPUT_FILE)\n"
888893
]
889894
},
890895
{
@@ -899,21 +904,21 @@
899904
{
900905
"cell_type": "code",
901906
"execution_count": null,
902-
"id": "b16a295c",
907+
"id": "76f5cdd5",
903908
"metadata": {},
904909
"outputs": [],
905910
"source": [
906911
"df = pd.read_csv(\"1_datasets/processed/teds_d_2023_cleaned.csv\")\n",
907912
"\n",
908913
"df_sample = df.sample(1000, random_state=42)\n",
909914
"\n",
910-
"df_sample.to_csv(\"1_datasets/sample/tedsd_sample.csv\", index=False)"
915+
"df_sample.to_csv(\"1_datasets/sample/tedsd_sample.csv\", index=False)\n"
911916
]
912917
}
913918
],
914919
"metadata": {
915920
"kernelspec": {
916-
"display_name": "Python 3",
921+
"display_name": ".venv",
917922
"language": "python",
918923
"name": "python3"
919924
},
@@ -927,7 +932,7 @@
927932
"name": "python",
928933
"nbconvert_exporter": "python",
929934
"pygments_lexer": "ipython3",
930-
"version": "3.12.10"
935+
"version": "3.14.0"
931936
}
932937
},
933938
"nbformat": 4,

0 commit comments

Comments
 (0)