vendredi 26 février 2021

How do I select random rows without using df.sample()?

If I wanted to select rows randomly from a data frame without using df.sample(), would something like

import random
peopleCount = people.iloc[[random.randint(1, 101)]], :]

work? Or am I approaching this the wrong way?




Aucun commentaire:

Enregistrer un commentaire