Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with arguments in sns.barplot() #25

Closed
naveeagrawal opened this issue Apr 10, 2023 · 2 comments
Closed

error with arguments in sns.barplot() #25

naveeagrawal opened this issue Apr 10, 2023 · 2 comments

Comments

@naveeagrawal
Copy link

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
Copy link
Author

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants