Last active
March 1, 2023 16:18
-
-
Save joshreini1/2b8c034a1fb2aa62f5ce3bfe1e55a1b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add data splits to the collection we just created | |
year_begin = 2014 | |
year_end = 2016 # exclusive | |
states = ['CA', 'NY'] | |
for year in range(year_begin, year_end): | |
for state in states: | |
tru.add_data_split(f'{year}-{state}', | |
pre_data = data[year][state]['data_preprocessed'].\ | |
drop('Sex', axis = 1), # drop sex from pre-data | |
post_data = data[year][state]['data_postprocessed'].\ | |
drop(['Sex_Female','Sex_Male'], axis = 1), # drop sex from post-data | |
label_data = data[year][state]['label'], | |
extra_data_df = data[year][state]['extra_data'].\ | |
reset_index(drop=True).\ | |
join(data[year][state]['data_preprocessed']['Sex'].reset_index(drop=True)), # add sex to extra data | |
split_type = "all") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment