【发布时间】:2021-07-16 13:25:06
【问题描述】:
如何使用数据框计算直方图的出现次数
d = {'color': ["blue", "green", "yellow", "red, blue", "green, yellow", "yellow, red, blue"],}
df = pd.DataFrame(data=d)
你是怎么走的
| color |
|---|
| blue |
| green |
| yellow |
| red, blue |
| green, yellow |
| yellow, red, blue |
到
| color | occurance |
|---|---|
| blue | 3 |
| green | 2 |
| yellow | 3 |
【问题讨论】:
标签: pandas dataframe histogram