Open devpatel2103 opened 1 year ago
I can confirm this.
Also, in the Describing Data with Pandas section:
car_sales.mean(numeric_only=True)
as numeric_only
defaults to False
.car_sales["Price"] = car_sales["Price"].str.replace('[\$\,\.]', '').astype(int)
now throws Invalid escape sequence '\$
. You need to use car_sales["Price"] = car_sales["Price"].str.replace('[$,]', '', regex=True).astype('float')
instead.I just wanted to add to this as well because I had similar problems starting in Section 6 - Lesson 53 and Lesson 55 with using car_sales.mean() and car_sales.groupby(["Make"]).mean().
I just wanted to post the panda link to why this "TypeError" occurs for those who come across this problem.
Hi everyone, I have tried this code, but it didn't work in my jupyter. Anyone know why and how to solve this?
This is my code: df = pd.read_csv("heart-disease.csv")
And this is the error explaination: AttributeError Traceback (most recent call last) Cell In[10], line 1 ----> 1 df = pd.read_csv("heart-disease.csv")
AttributeError: module 'pandas' has no attribute 'read_csv'
Re import pandas correctly And check have you made any mistakes
In[24]
This does not work anymore car_sales.groupby(["Make"]).mean()
The mean now needs a condition in order for it to work car_sales.groupby(["Make"]).mean(numeric_only=True)