Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

shuffle rows dataframe

df = df.sample(frac=1).reset_index(drop=True) #Use if you want to reset index order

df.sample(frac=1) # Use for no reset in index order
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #shuffle #rows #dataframe
ADD COMMENT
Topic
Name
4+3 =