Shuffle data with pandas

You can shuffle with the following one line.

df.sample(frac=1).reset_index(drop=True)

reference

python - Shuffle DataFrame rows - Stack Overflow

Recommended Posts

Shuffle data with pandas
Data visualization with pandas
Data manipulation with Pandas!
Data processing tips with Pandas
Versatile data plotting with pandas + matplotlib
Read pandas data
Try converting to tidy data with pandas
Working with 3D data structures in pandas
Example of efficient data processing with PANDAS
Best practices for messing with data with pandas
Data analysis with python 2
Try to aggregate doujin music data with pandas
Processing datasets with pandas (1)
Convert 202003 to 2020-03 with pandas
Processing datasets with pandas (2)
Merge datasets with pandas
Read Python csv data with Pandas ⇒ Graph with Matplotlib
Visualize data with Streamlit
Learn Pandas with Cheminformatics
Reading data with TensorFlow
Interactively visualize data with TreasureData, Pandas and Jupyter.
Data Augmentation with openCV
Make holiday data into a data frame with pandas
Normarize data with Scipy
Data analysis with Python
LOAD DATA with PyMysql
Get Amazon RDS (PostgreSQL) data using SQL with pandas
How to convert horizontally held data to vertically held data with pandas
Be careful when reading data with pandas (specify dtype)
Data analysis environment construction with Python (IPython notebook + Pandas)
How to extract non-missing value nan data with pandas
Process csv data with python (count processing using pandas)
How to extract non-missing value nan data with pandas
Sample data created with python
Read csv with python pandas
Embed audio data with Jupyter
Graph Excel data with matplotlib (1)
Artificial data generation with numpy
Extract Twitter data with CSV
Get Youtube data with python
Clustering ID-POS data with LDA
Learn new data with PaintsChainer
Binarize photo data with OpenCV
[Python] Change dtype with pandas
Save tweet data with Django
Standardize by group with pandas
Data analysis using python pandas
Prevent omissions with pandas print
Interpolate 2D data with scipy.interpolate.griddata
Read json data with python
Notes on handling large amounts of data with python + pandas
Ingenuity to handle data with Pandas in a memory-saving manner
[Stock price analysis] Learning pandas with fictitious data (002: Log output)
A collection of methods used when aggregating data with pandas
Save & load data with joblib, pickle
Development memorandum ~ pandas, forecast, data structure ~
Extract the maximum value with pandas.
Hit treasure data from Python Pandas
Data visualization method using matplotlib (+ pandas) (5)
[Stock price analysis] Learn pandas with Nikkei 225 (004: Change read data to Nikkei 225)
How to deal with imbalanced data