In [86]: df Out[86]: <class 'pandas.core.frame.DataFrame'> Int64Index: 2634 entries, 0 to 2633 Data columns (total 8 columns): 0 2634 non-null values 1 2634 non-null values 2 2634 non-null values 3 2634 non-null values 4 2634 non-null values 5 2634 non-null values 6 2634 non-null values diff 2634 non-null values dtypes: float64(5), int64(1), object(2) In [87]: rows = random.sample(df.index.tolist(