I have a dataframe like:
df
name value
0 a 10
1 a 5
2 b 4
3 b 8
I want to create filtered datasets using the 'name' feature. Something like:
for i in ['a', 'b']:
df_{i} = df[df['name'] == i]
df_a
name value
0 a 10
1 a 5
df_b
name value
2 b 4
3 b 8
Which alterations are necessary to do that?