Conditional plots w seaborn & python 152-6

Screen Link: Mission 6/11 of Conditional Plots with Seaborn and Python

Found a discrepancy between seaborn version inside of dq platform and outside (I follow along with the missions inside my own notebook). NBD, just wanted to post in case others come looking.

fg = sns.FacetGrid(titanic, col='Pclass', height=6)
fg.map(sns.kdeplot, 'Age',shade=True)
sns.despine(left=True,bottom=True)
plt.xlabel('Age')
plt.show()

What actually happened:

TypeErrorTraceback (most recent call last)
<ipython-input-1-5e4164daaf2b> in <module>()
----> 1 fg = sns.FacetGrid(titanic, col='Pclass', height=6)
      2 fg.map(sns.kdeplot, 'Age',shade=True)
      3 sns.despine(left=True,bottom=True)
      4 plt.xlabel('Age')
      5 plt.show()

TypeError: __init__() got an unexpected keyword argument 'height'

height is used in current version. size is used in dq seaborn.

Hey @mctopherganesh, You’re right that this is due to an older version of seaborn. Running the line print(sns.__version__) (since seaborn was already imported as sns) shows that the version on the platform is 0.7.1. The documentation always shows the most recent version, so that’s probably why there seems to be a discrepancy (likely at the time the documentation matched the lesson). The current documentation is for v0.10.1. At the top of the page if you click Site --> Release Notes, it shows you what has changed in each version.

Therefore since this current mission still uses the older version of seaborn, you’d just have to make do with the size parameter.

1 Like