这个问题在这里已有答案:
我有一个简单的数据集,上面有几天:
dt, value, coltype
2017-01-01, 10, A
2017-01-02, 11, B
2017-01-03, 30, A
2017-01-04, 90, C
2017-01-05, 9, A
2017-01-06, 13, E
2017-01-07, 12, C
2017-01-08, 10, B
我想基于工作日创建一个简单的盒子图:
import seaborn as sns
import pandas as pd
df = read_csv('mycsv.txt')
df.index = pd.to_datetime(df.dt)
sns.boxplot(x=df.index.weekday_name, y=value)
有没有办法在boxplot函数上直接进行,而不创建另一列?