Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas sample rows

# To sample a fixed number of rows
df.sample(n = 100)

# To sample a fraction of rows
df.sample(frac = 0.5)
 
PREVIOUS NEXT
Tagged: #pandas #sample #rows
ADD COMMENT
Topic
Name
2+7 =