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

sns.barplot in EDA #220

Closed
gexahedron opened this issue Dec 10, 2022 · 5 comments
Closed

sns.barplot in EDA #220

gexahedron opened this issue Dec 10, 2022 · 5 comments

Comments

@gexahedron
Copy link

i think instead of
ax = sns.barplot(list(tags), list(tag_counts))
it should be
ax = sns.barplot(x=list(tags), y=list(tag_counts))
in code at https://madewithml.com/courses/mlops/exploratory-data-analysis/

@GokuMohandas
Copy link
Owner

hi @gexahedron, input parameter names for functions are optional here (plotting order is usually well understood) but you are more than welcome to use them explicitly. The output will be the same for both. However, I do normally advocate being verbose for custom function we create and use.

@gexahedron
Copy link
Author

gexahedron commented Dec 11, 2022

What i want to say, is that your code doesn't work for me:
ax = sns.barplot(list(tags), list(tag_counts)) gives an error:
TypeError: barplot() takes from 0 to 1 positional arguments but 2 were given
That's probably because x is not the first argument to barplot, it's data - https://seaborn.pydata.org/generated/seaborn.barplot.html

@GokuMohandas
Copy link
Owner

Hi @gexahedron, hmm I'm able to run through all of the code and it produces the plot I'm looking for. Does the plot look different when you run your code compared to what's in the lesson?

@gexahedron
Copy link
Author

As I mention above, I don't get any plot at all - it's a TypeError

@GokuMohandas
Copy link
Owner

Hi @gexahedron, looks like I had a previous version of seaborn that wasn't producing this error but now I see what you see! Thank you for bringing this to my attention and I'll explicitly call out x and y arguments for all plotting functions.

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