You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.head() and .tail() are great tools for quick data interrogations, but when data is sorted they are often far from representative. It would be great if there was a simple command to pull an arbitrary number of random rows and display them for a more representative way to spotcheck data.
It would behave something like:
def rand_rows(df, num_rows = 5):
from numpy import random as rm
subset = rm.choice(df.index.values, size = num_rows)
return df.loc[subset]
a_data_frame = pd.DataFrame({'col1':range(10,20), 'col2':range(20,30)})
rand_rows(a_data_frame)
rand_rows(a_data_frame, 6)
The text was updated successfully, but these errors were encountered:
We already have an issue for that: #2419
It's just a matter of someone implementing it. Give it a go if you want try! I don't think anyone has started.
.head() and .tail() are great tools for quick data interrogations, but when data is sorted they are often far from representative. It would be great if there was a simple command to pull an arbitrary number of random rows and display them for a more representative way to spotcheck data.
It would behave something like:
The text was updated successfully, but these errors were encountered: