Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.DataFrame({'a':[166,34,12,56],
- 'b': [27.9625,24.6825,32.738,45.344]})
- print df
- print (df['a']*df['b'])
- print (df['a']*df['b']).round(2)
- a b
- 0 166 27.9625
- 1 34 24.6825
- 2 12 32.7380
- 3 56 45.3440
- 0 4641.775
- 1 839.205
- 2 392.856
- 3 2539.264
- dtype: float64
- 0 4641.77
- 1 839.20
- 2 392.86
- 3 2539.26
- dtype: float64
Add Comment
Please, Sign In to add comment