Reputation: 87
I need to convert the datatype of y_test from object to float64. I first converted into an array of strings ( In[54] ) and then to an array of floating point numbers (Inputs [83] & [85]) but it is not added to the y_test data frame.
y_test feature CO(ppm) is still displayed as object datatype ( Out[90] ).
Can someone please help me understand how to accomplish this? Thank you.
Upvotes: 0
Views: 69
Reputation: 12397
Try:
y_test['CO'] = y_test.CO.apply(lambda x: x.replace(',','')).astype(float)
Upvotes: 1