Last answered:

21 Jan 2022

Posted on:

08 Nov 2021

3

Don't forget about library updates

Remember to update the libraries to avoid errors with matplotlib and seaborn:

!pip install --upgrade matplotlib
!pip install --upgrade pandas
!pip install --upgrade seaborn

The code of the video also gives this warning:

FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning

It is therefore necessary to invert the first two arguments of scatterplot and to explicitly indicate the attributes x and y as follows:

plt.figure(figsize=(12, 8))
sns.scatterplot(x=df_real_estate["Area (ft.)"],
                y=df_real_estate["Price"],
                hue=df_real_estate["Building Type"],
                palette=["black", "darkblue", "purple", "pink", "white"],
                style=100)
plt.title("Relationship between Area and Price of California Real Estate",
         fontsize=14,
         weight="bold")
plt.xlabel("Area (sq. ft.)", weight="bold")
plt.ylabel("Price (000's of $)", weight="bold")
plt.show()
1 answers ( 0 marked as helpful)
Posted on:

21 Jan 2022

0

That is very helpful! Thank you so much for sharing!! (:

Submit an answer