Try to Google/Stackoverflow the last line
Unable to convert array of bytes/strings into decimal numbers with dtype='numeric'
Hi , I tried to understand and facing some doubts about error which getting during execution.
Below is my dtypes :
age int64 sex object bmi float64 children int64 smoker object region object expenses float64 dtype: object
Index(['age', 'bmi', 'children', 'expenses', 'sex_female', 'sex_male', 'smoker_no', 'smoker_yes', 'region_northeast', 'region_northwest', 'region_southeast', 'region_southwest'], dtype='object')
Error : ValueError: could not convert string to float: 'male'
Question/Query : I am not able to understand why programme is trying to convert object or string into float data type. What is the need to perform conversion here.
The odd that you find a specialist of your problem at hand here is very slim. This kind of super focused question work better at stackoverflow.com/
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Try to Google/Stackoverflow the last line
Hi , I tried to understand and facing some doubts about error which getting during execution.
Below is my dtypes :
age int64
sex object
bmi float64
children int64
smoker object
region object
expenses float64
dtype: object
Index(['age', 'bmi', 'children', 'expenses', 'sex_female', 'sex_male',
'smoker_no', 'smoker_yes', 'region_northeast', 'region_northwest',
'region_southeast', 'region_southwest'],
dtype='object')
Error : ValueError: could not convert string to float: 'male'
Question/Query : I am not able to understand why programme is trying to convert object or string into float data type. What is the need to perform conversion here.
The odd that you find a specialist of your problem at hand here is very slim.
This kind of super focused question work better at stackoverflow.com/