Data Preprocessing

How to Sample a Dataframe in Python Pandas

A ready-to-run code with different techniques to sample a dataset in Python Pandas

Angelica Lo Duca
Towards Data Science
4 min readJul 7, 2021

--

Image by Peggy und Marco Lachmann-Anke from Pixabay

It may happen that you need only some rows of your Python dataframe. You can achieve this result, through different sampling techniques.

--

--

Researcher | +50k monthly views | I write on Data Science, Python, Tutorials, and, occasionally, Web Applications | Book Author of Comet for Data Science