Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: how to know if python is 64 or 32 bit 
Python :: append dataframe to another dataframe 
Python :: python string list to float 
Python :: stop server django programmatically 
Python :: python first two numbers 
Python :: get current working directory python 
Python :: mnist fashion dataset 
Python :: get all classes from css file using python 
Python :: how to split channels wav python 
Python :: open tiff image pyt 
Python :: how to download a page in python 
Python :: Renaming row value in pandas 
Python :: py current date 
Python :: python print to terminal with color 
Python :: how to downgrade a package python 
Python :: age calculator in python 
Python :: django import models 
Python :: print terminal url 
Python :: open a filename starting with in python 
Python :: pie chart python pandas 
Python :: is string python 
Python :: quadratic formula python 
Python :: python requests header 
Python :: individuare stella polare con piccolo carro 
Python :: prekladac 
Python :: how to remove stopwords from a string in python 
Python :: Python program to remove duplicate characters of a given string. 
Python :: dynamo scripts template 
Python :: pytho narrondir un nombre 
Python :: python gzip 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =