I have this dataframe df
:
col1 col2 col3
673 89279 902
893 894 897
083 37 23
94 382 342
And I need to randomaly shuffle the rows except the first one, any help with that please?
I have this dataframe df
:
col1 col2 col3
673 89279 902
893 894 897
083 37 23
94 382 342
And I need to randomaly shuffle the rows except the first one, any help with that please?
Try this
df = pd.concat([df[:1], df[1:].sample(frac=1)]).reset_index(drop=True)