【发布时间】:2020-02-05 06:22:25
【问题描述】:
大家好,我有这个数据集:
import pandas as pd
# intialise data of lists.
data = {'Year':['2017', '2018', '2018', '2019'],'Month':['1', '1', '2', '3'],'Outcome':['dead', 'alive', 'alive', 'empty'], 'outcome_count':[20, 21, 19, 18]}
# Create DataFrame
dfy = pd.DataFrame(data)
# Print the output.
print(dfy)
我确实想根据应该是月份和年份的时间段来绘制结果。现在,月份和年份在不同的列上,我如何将它们组合起来,以便我得到一个相对于月份和年份的结果图表。图例应该有结果名称?
【问题讨论】:
-
@LivingstoneM 我的建议对你有什么效果?