Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
randomly select n rows from pandas dataframe
Waleed
Programming language:
Python
2021-06-18 16:06:22
0
Q:
randomly select n rows from pandas dataframe
unknownprotocol
Code:
Python
2021-07-02 21:11:20
# n must be less than your sample size or you get an error df1.sample(n = 3, replace = False)
0
Tags
data
row
dataframe
rows
pandas
select
Related
remove all rows without a value pandas
pandas dataframe remove rows by column value
select rows from dataframe pandas
pandas repeat rows n times
remove 0th row pandas
remove rows from a dataframe that are present in another dataframe?
python randomly shuffle rows of pandas dataframe
pandas drop rows with value in list
python count the number of zeros in each row of a pandas dataframe
select specific rows from dataframe in python
remove rows from dataframe
get number of rows in a pandas dataframe
python - count total numeber of row in a dataframe
pandas shuffle rows
how can i remove random symbols in a dataframe in Pandas
python - row slice dataframe by number of rows
getting dummies and input them to pandas dataframe
how to get a row of a dataframe with subset columns in python
New to Communities?
Join the community