I'm new to python so please give me some slack!
I am trying to split a data frame into smaller ones based on a unique row value.
I've done this via this code:
Station2 = df.loc[(df["Station"] == "STN002")]
Station2
I'm trying to make dataframes for each station (STN004, STN 006, ... STN184, STN198, etc.)
I know I could do this by hand and set each variable individually, but is there a way to make a function/loop to do this automatically? Just want to understand python better.
the function would have to do something like this:
StationX = df.loc[df["Station"] == "STNX")]
#where it loops through the df to name specific dataframes based on the station ID?
Thank you for the help!
S