mrdbourke / zero-to-mastery-ml

All course materials for the Zero to Mastery Machine Learning and Data Science course.
https://dbourke.link/ZTMmlcourse
2.88k stars 3.4k forks source link

Predicting bulldozer price - Converting string to category #56

Open LeeharikaSiddabattuni opened 1 year ago

LeeharikaSiddabattuni commented 1 year ago

error1 error2 Instead of getting objects in an order I am getting bound method exception. The output is not as shown in the course. Please solve this and let me know.

Sreeram0303 commented 1 year ago

same error i too faced the issue is due to the update in api.types.is_string_dtype method in recent update they made it to detect string type strictly but in the course they used it for both string and object. So the fix will be use pd.api.types.is_object_dype(content) Hope this will help and solve the issue

Shuraimi commented 6 months ago

Thanks @Sreeram0303 . I was searching for this from a lot time if only I'm facing this issue or somebody else also has admitted this issue.

When I used pd.api.types.is_string(df['UsageBand']), I get output as False and when I tried on another column which has no missing values, I got True

So I thought that if we have missing values and when I call the above function, I'll get False.