I try to plot some graphs using seaborn.boxplot(). Here's my code:
import seaborn as sbn
import pandas as pd
import matplotlib.pyplot as plt
fig, axes = plt.subplots(figsize = (15,8), nrows=2, ncols=3);
sbn.boxplot(y=df['national_rank'], orient='v', ax=axes[0], palette='Oranges')
sbn.boxplot(y=df['world_rank'], orient='v', ax=axes[1])
sbn.boxplot(y=df['quality_of_education'], orient='v', ax=axes[2])
sbn.boxplot(y=df['alumni_employment'], orient='v', ax=axes[3], palette='Oranges')
sbn.boxplot(y=df['quality_of_faculty'], orient='v', ax=axes[4], palette='Oranges')
sbn.boxplot(y=df['publications'], orient='v', ax=axes[5], palette='Oranges')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-105-3c63c384eb3b> in <module>()
1 fig, axes = plt.subplots(figsize = (15,8), nrows=2, ncols=3);
----> 2 sbn.boxplot(y=df['national_rank'], orient='v', ax=axes[0], palette='Oranges')
3 sbn.boxplot(y=df['world_rank'], orient='v', ax=axes[1])
4 sbn.boxplot(y=df['quality_of_education'], orient='v', ax=axes[2])
5
3 frames
/usr/local/lib/python3.7/dist-packages/seaborn/categorical.py in draw_boxplot(self, ax, kws)
439 continue
440
--> 441 artist_dict = ax.boxplot(box_data,
442 vert=vert,
443 patch_artist=True,
AttributeError: 'numpy.ndarray' object has no attribute 'boxplot'
What can I do wrong? I can't understand what it can be. Thanks a lot for your help.