Day 8 Pandas cut 定義 labels
2019/05/12 上午 06:20
機器學習共學討論版
鄭皓尹
觀看數:3
回答數:1
收藏數:0
ml100-2
ml100-2-d08
我想要在pandas.cut()中的參數labels設定如圖的list,但是執行後結果似乎沒變。如果我要自定義圖片下方的四個分群名稱應該怎麼做呢?
回答列表
-
2019/05/13 上午 02:11張維元 (WeiYuan)贊同數:1不贊同數:0留言數:0
嗨,根據文件:
1. https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.boxplot.html
2. https://matplotlib.org/api/_as_gen/matplotlib.pyplot.boxplot.html#matplotlib.pyplot.boxplot
應該要用 labels 這個參數:
```
df.boxplot(column=..., by=..., labels=[...])
```