Is there a way to select random rows from a DataFrame in Pandas.
In R, using the car package, there is a useful function some(x, n) which is similar to h
some(x, n)
Below line will randomly select n number of rows out of the total existing row numbers from the dataframe df without replacement.
df=df.take(np.random.permutation(len(df))[:n])