【问题标题】:Plot lines with ipython notebook + pandas用 ipython notebook + pandas 绘制线条
【发布时间】:2014-02-02 05:42:42
【问题描述】:

我有以下 CSV:

Name,Concurrency,RPS
gunicorn,50,1000
gunicorn,150,1700
paster,50,100
paster,150,300

我想绘制它,使 X 是“RPS”,X 是“Conccurency”,并且每个“名称”(gunicorn、paster)都有一行。

看起来像这样,但带有线条:

P = Paster
G = Gunicorn

200        P              G
100
50    P               G
0
     100     500    1000     2000

【问题讨论】:

    标签: python csv matplotlib pandas ipython-notebook


    【解决方案1】:

    先分组,然后绘制。

    df.groupby('Name').plot('RPS', 'Concurrency')
    

    【讨论】:

    • 你是怎么把它变成不同颜色的?我可以为颜色添加一个图例吗?
    猜你喜欢
    • 2013-01-01
    • 2015-10-09
    • 2014-02-17
    • 2015-06-14
    • 2018-03-24
    • 2013-03-06
    • 1970-01-01
    • 2012-05-17
    • 1970-01-01
    相关资源
    最近更新 更多