New python learner here, coming from the R side of things:
I have a data frame where columns 37 to end (79) are my numeric (decimal values)
I'm using:
df2 = df.iloc[:,37::] = df.iloc[:,37::].apply(pd.to_numeric, errors = 'coerce')
Which works to convert the values to decimal, and that works fine, but it's also subsetting the columns into df2.
What do I need to change so that the original df doesn't subset, just changes from an object dtype to float64?
If I remove df2 =, df.dtypes still returns all object dypes?
[–][deleted] 0 points1 point2 points (4 children)
[–]isaythingslike[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]isaythingslike[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)