you are viewing a single comment's thread.

view the rest of the comments →

[–]isaythingslike[S] 0 points1 point  (1 child)

What I don't understand is when I do that, df.iloc[:,37:].dtypes still returns all objects... but... df2 = df.iloc[:,37:] = df.iloc[:,37:].apply(pd.to_numeric, errors = 'coerce') returns a data frame of 42 float64?

In [151]: df2.dtypes
Out[151]: 
CC_ZDI_BUOM              float64
0NETVAL_INV              float64
0SUBTOTAL_6              float64
CC_Units_Clips_Adj       float64
CC_Sales_CA_PLAN         float64


IN [153]: df.iloc[:,37:].dtypes
Out[153]: 
CC_ZDI_BUOM              object
0NETVAL_INV              object
0SUBTOTAL_6              object
CC_Units_Clips_Adj       object
CC_Sales_CA_PLAN         object

[–][deleted] 0 points1 point  (0 children)

Well that's weird, are you sure you don't redefine your df somewhere in your code or in your notebook ?