Let’s say you have a Pandas DataFrame called ‘df’ that has 50 thousand rows in it and you want to get a random sample out of it that contains 300 records. Pandas has a built in function called sample() that makes this very easy. All you have to do is decide on the name of … Continue reading Pandas: How to get a random sample DataFrame of x length using .sample( )