Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (18.4k points)
I am getting errors for the code when running it on a 'tips' dataset but I can run it on a tulips dataset using 2 rows and 2 column grid for the 4 variables there. I wonder why am I getting 'too many indices'. The code is also available at the python-graph-gallery from where I obtained it. Am I missing something?

1 Answer

0 votes
by (36.8k points)

Your axes is the one-dimensional array. Try:

sns.distplot(df["total_bill"], color="skyblue", ax=axes[0])

sns.distplot(df["tip"], color="olive", ax=axes[1])

Improve your knowledge in data science from scratch using data scientist

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...