FutureWarning: Pass the following variable as a keyword arg: x. From version 0.12, the only valid positional argument will be data
, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
FutureWarning
使用 import seaborn as sns
sns.countplot(goldmedalNU_no[‘Age’])
解决办法:
sns.countplot(x=goldmedalNU_no[‘Age’])
countplot方法中必须要x或者y参数,不然就报错。
官方给出的countplot方法及参数:
sns.countplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, orient=None, color=None, palette=None, saturation=0.75, dodge=True, ax=None, **kwargs)