Try this:
df1 = df.loc[df['ID'] == 0902]
df2 = df.loc[df['ID'] == 0105]
Or this:
df1, df2 = [group for _, group in df.groupby('ID')]
Or if you want it dynamically:
dct = {f'df{idx}': group for _, group in df.groupby('ID')]}
print(dct)
Or:
dct = {}
for idx, v in enumerate(df['ID'].unique()):
dct[f'df{idx}'] = df.loc[df['ID'] == v]
print(dct)
And print like this for specific dataframe:
print(dct['df1'])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…