I have a dataframe as shown below. I would like to create multiple dataframes from this dataframe based on column ID.
df = pd.DataFrame(results)
print(df)
Result is:
ID NAME COLOR
0 01 ABC RED
1 01 ABC ORANGE
2 01 ABC WHITE
3 02 DEF RED
4 02 DEF PURPLE
5 02 DEF GREEN
6 02 DEF ORANGE
7 02 DEF BLACK
8 03 GHI RED
9 03 GHI BLACK
10 03 GHI GREEN
11 03 GHI ORANGE
12 04 JKL RED
Multiple Dataframes should come as shown below:I am not able to put it into python code, pls help.
ID NAME COLOR
0 01 ABC RED
1 01 ABC ORANGE
2 01 ABC WHITE
ID NAME COLOR
0 02 DEF RED
1 02 DEF PURPLE
2 02 DEF GREEN
3 02 DEF ORANGE
4 02 DEF BLACK
ID NAME COLOR
0 03 GHI RED
1 03 GHI BLACK
2 03 GHI GREEN
3 03 GHI ORANGE
ID NAME COLOR
0 04 JKL RED