Python 关于海生kde情节的传说

Python 关于海生kde情节的传说,python,pandas,matplotlib,seaborn,Python,Pandas,Matplotlib,Seaborn,我不知道如何把传奇故事放在海上kde的情节上 uses=df.primary\u use.unique() plt.图(figsize=(7,7)) ax=plt.axs() plt.图例(使用) 用于以下用途: sns.kdeplot(df[df['primary_use']==use]['wind_speed'],ax=ax) 请参见此处的输出: 使用数组看起来像: 数组(['Education'、'住宿/住宿'、'办公室', '娱乐/公众集会','公共服务'],dtype=object

我不知道如何把传奇故事放在海上kde的情节上

uses=df.primary\u use.unique()
plt.图(figsize=(7,7))
ax=plt.axs()
plt.图例(使用)
用于以下用途:
sns.kdeplot(df[df['primary_use']==use]['wind_speed'],ax=ax)
请参见此处的输出:

使用
数组看起来像:

数组(['Education'、'住宿/住宿'、'办公室',
'娱乐/公众集会','公共服务'],dtype=object)

使用
是图例的本意,但它为每个绘图设置了
风速

尝试使用
标签
参数:

for use in uses: 
    sns.kdeplot(df[df['primary_use'] == use]['wind_speed'], ax=ax, label=use)
我的MCVE:

df = pd.DataFrame(index=np.random.choice(['a','b','c'], 100), data=np.random.randint(0,100,(100)))
df=df.rename_axis('use').reset_index()

fig, ax = plt.subplots()
use=['a','b','c']
for u in use:
    sns.kdeplot(df[df['use'] == u][0], ax=ax, label=u)
输出: