0

Can someone help me, I have COVID-19 data for the US and it has data for all states based and I separated in 55 data frames (for 55 states).

Problem 1: I want to split all 55 data frame to Train/Test/val(80/10/10).

Code for splitting 55 states data is below: I used Pandas

Uniq_Provinces = Covid19.Province_State.unique()

dataframes = []

for filename in Uniq_Provinces:

   df =  pd.DataFrame(Covid19[Covid19['Province_State'] == filename])

   dataframes.append(df)

Can you please help as I am not so good at writing python code as well as how to finally merge all training, test and val again

Tengis
  • 2,721
  • 10
  • 36
  • 58
Priyanka
  • 1
  • 1
  • Uniq_Provinces = Covid19.Province_State.unique() dataframes = [] for filename in Uniq_Provinces: df = pd.DataFrame(Covid19[Covid19['Province_State'] == filename]) dataframes.append(df) – Priyanka Apr 17 '21 at 03:41
  • Have you tried this [solution](https://stackoverflow.com/questions/38250710/how-to-split-data-into-3-sets-train-validation-and-test) ? – Sreekant Shenoy Apr 17 '21 at 03:59
  • 1
    Does this answer your question? [How to split data into 3 sets (train, validation and test)?](https://stackoverflow.com/questions/38250710/how-to-split-data-into-3-sets-train-validation-and-test) – yudhiesh Apr 17 '21 at 06:09

0 Answers0