I need to create multiple dataframes from slices of a bigger dataframe in pandas based on a condition. The different dataframes have to be named on the basis of some row values of the big dataframe.
This is the big dataframe:
Id Valore
ID554 53.0
ID554 43.0
ID522 42.0
ID522 32.0
ID566 26.0
therefore the different dataframes have to be named ID554, ID522, ID566 and so on. I have tried this:
id=df['Id'].unique()
for a in id:
a=df.loc[(df['ID']==a)]
it does not work though..