Python Library/Pandas
[Pandas] shuffle
goatlab
2022. 10. 17. 19:29
728x90
반응형
SMALL
shuffle
pandas에서 데이터를 섞어주는 함수가 존재한다.
df
# row 전체 shuffle
df = df.sample(frac = 1)
df
# shuffling하고 index reset
df = df.sample(frac = 1).reset_index(drop = True)
df
728x90
반응형
LIST