Advertisement
elena1234

summary statistics and accumulations in Python

Mar 5th, 2023 (edited)
810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. titanic.describe()
  2. titanic.describe(include= 'O') # for object data types
  3.  
  4. titanic.count(axis = "columns")
  5. titanic.count(axis = 1)
  6.  
  7. titanic.mean(axis = 1)
  8.  
  9. titanic.sum(axis = 0)
  10.  
  11. titanic.fare.cumsum(axis = 0)
  12.  
  13. titanic.age.unique()
  14. titanic.nunique(axis = 1, dropna=False)
  15.  
  16. titanic.loc[titanic.age.idxmin()]
  17.  
  18. titanic.nlargest(n = 5, columns = "fare")
  19. titanic.nsmallest(n = 1, columns = "age")
  20.  
  21. titanic.agg(["mean", "std", "min", "max", "median"])
  22. titanic.agg({"survived": "mean", "age":["min", "max"]})
  23.  
  24. titanic.corr()
  25. titanic.survived.corr(titanic.pclass)
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement