我有一个数据集,包括不同年份和月份不同种类贷款的投诉号码。你知道吗
我需要绘制一个折线图,显示投诉的数量与不同的彩色线不同的贷款类型在这段时间。 我的数据如下:
'Year_Month' 'Issue' 'Complaints_Count'
201601 Can't repay my loan 100
201601 Dealing with my lender or servicer 220
201601 Getting a loan 13
201602 Can't repay my loan 113
201602 Dealing with my lender or servicer 252
201602 Getting a loan 11
201603 Can't repay my loan 180
201603 Dealing with my lender or servicer 630
201603 Getting a loan 7
201604 Can't repay my loan 237
我的x轴应该是“年\月”,应该在折线图上显示的值存储在“投诉\计数”中。不同的“问题”应该有不同的行。(问题类型将显示在图例中,以确定每行的问题名称)。你知道吗
我在其他地方找不到解决方案,所以如果有人能帮我绘制上述数据,我将不胜感激。你知道吗
Seaborn非常适合这种任务。你知道吗
首先,将数据加载到panda数据帧中。例如,如果您有csv格式的数据:
然后使用seaborn绘制:
您可以使用许多选项来调整绘图。查看
factorplot()
上的full documentation。你知道吗相关问题 更多 >
编程相关推荐