GokuMohandas / mlops-course

Learn how to design, develop, deploy and iterate on production-grade ML applications.
https://madewithml.com
MIT License
2.96k stars 515 forks source link

error with arguments in sns.barplot() #25

Closed naveeagrawal closed 1 year ago

naveeagrawal commented 1 year ago

Error with arguments in sns.barplot() in EDA section.

https://github.com/GokuMohandas/mlops-course/blob/main/notebooks/tagifai.ipynb


TypeError Traceback (most recent call last) in <cell line: 4>() 2 tags, tag_counts = zip(*Counter(df.tag.values).most_common()) 3 plt.figure(figsize=(10, 3)) ----> 4 ax = sns.barplot(list(tags), list(tag_counts)) 5 plt.title("Tag distribution", fontsize=20) 6 plt.xlabel("Tag", fontsize=16)

TypeError: barplot() takes from 0 to 1 positional arguments but 2 were given

the seaborn version in the colab notebook is 0.12.2

naveeagrawal commented 1 year ago

the error could be resolved by replacing ax = sns.barplot(list(tags), list(tag_counts)) with ax = sns.barplot(x=list(tags), y=list(tag_counts))

GokuMohandas commented 1 year ago

hey @naveeagrawal, thanks for sharing this. A few others brought this up too and it's due to Colab auto-upgrading their packages every so often (seaborn api changed). I was going to push the change but have a lot of changes coming soon so decided to wait. Also we won't be using Google colab anymore because it essentially causes projects like this to break every few months.