Reputation: 31
So I was successfully able to change the strings to float, but I want it to permanently stay that way, something like a inplace=True. However, I wasn't able to do the inplace=True and receive an error when I try. Basically I want to see the changes kept in place when I do nba.head().
I would appreciate all help :).
nba[["G","GS","MP"]] = nba[["G","GS","MP"]].apply(pd.to_numeric)
Upvotes: 0
Views: 886
Reputation: 120429
Try:
nba[["G","GS","MP"]] = nba[["G","GS","MP"]].astype(float)
Upvotes: 1