Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1.             # This fails
  2.             roster['CMHeight'] = roster['Ht'].str.split("-").str[0].astype(int) * 30.48 + \
  3.                                  roster['Ht'].str.split("-").str[1].astype(int) * 2.54,
  4.            
  5.             # This works - why?
  6.             roster['feet'] = roster['Ht'].str.split("-").str[0].astype(int)
  7.             roster['inches'] = roster['Ht'].str.split("-").str[1].astype(int)
  8.             roster['cmheight'] = roster['feet'] * 30.48 + roster['inches'] * 2.54
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement