Guest User

Untitled

a guest
Dec 14th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. df = pd.DataFrame({'a':[166,34,12,56],
  2. 'b': [27.9625,24.6825,32.738,45.344]})
  3.  
  4. print df
  5. print (df['a']*df['b'])
  6. print (df['a']*df['b']).round(2)
  7.  
  8. a b
  9. 0 166 27.9625
  10. 1 34 24.6825
  11. 2 12 32.7380
  12. 3 56 45.3440
  13. 0 4641.775
  14. 1 839.205
  15. 2 392.856
  16. 3 2539.264
  17. dtype: float64
  18. 0 4641.77
  19. 1 839.20
  20. 2 392.86
  21. 3 2539.26
  22. dtype: float64
Add Comment
Please, Sign In to add comment