Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3.  
  4. np.random.seed([3,1415])
  5. df = pd.DataFrame(np.random.randn(100, 10), columns=list('ABCDEFGHIJ'))
  6.  
  7. df.describe()
  8.  
  9. d1 = df.mask(np.random.choice([True, False], df.shape, p=[.2, .8]))
  10. d1.describe()
  11.  
  12. d1.stack().groupby(level=1).describe().unstack(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement