I have a Panda dataframe such as this:
col value
0 1.28
1 4
2 9.34
3 13
4 15
5 23
6 35
When I do df.info()
I get that value is object
however when I test this as follows:
A = df['value'].reset_index().applymap(lambda x: isinstance(x, (float)))
A[A['value']==False].shape[0]
I get zero rows. Also some models throw an error because of data type thing, then what I would do is to force the data type to be float.
A['value'] = A['value'].astype('float')
Can some one explain how you can investigate why data type is not float and what is wrong with my code for detecting the data type is float or not?