sns.barplot in EDA #44

Closed
opened 2025-11-02 00:02:16 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @gexahedron on GitHub (Dec 10, 2022).

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/

Originally created by @gexahedron on GitHub (Dec 10, 2022). 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/
Author
Owner

@GokuMohandas commented on GitHub (Dec 11, 2022):

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.

@GokuMohandas commented on GitHub (Dec 11, 2022): 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.
Author
Owner

@gexahedron commented on GitHub (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

@gexahedron commented on GitHub (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
Author
Owner

@GokuMohandas commented on GitHub (Dec 14, 2022):

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?

@GokuMohandas commented on GitHub (Dec 14, 2022): 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?
Author
Owner

@gexahedron commented on GitHub (Dec 19, 2022):

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

@gexahedron commented on GitHub (Dec 19, 2022): As I mention above, I don't get any plot at all - it's a TypeError
Author
Owner

@GokuMohandas commented on GitHub (Mar 16, 2023):

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.

@GokuMohandas commented on GitHub (Mar 16, 2023): 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/Made-With-ML#44