Horje
Getting Random rows in dataframe Code Example
Getting Random rows in dataframe
df = pandas.DataFrame(pandas.np.random.random(100))

# Randomly sample 70% of your dataframe
df_percent = df.sample(frac=0.7)

# Randomly sample 7 elements from your dataframe
df_elements = df.sample(n=7)




Python

Related
change value in pandas dataframe cell Code Example change value in pandas dataframe cell Code Example
flask if statement Code Example flask if statement Code Example
save request response json to file python Code Example save request response json to file python Code Example
import matplotlib.pyplot as plt Code Example import matplotlib.pyplot as plt Code Example
python random string Code Example python random string Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7