2014-01-14 37 views
0

我有以下CSV:的繪圖線與IPython的筆記本+熊貓

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

,我想繪製它使得x「RPS」,X爲「Conccurency」,並有一條線每個「名稱「(gunicorn,貼紙)。

會是這個樣子,但用線:

P = Paster 
G = Gunicorn 

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

回答

3

GROUPBY它,然後再繪製它。

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

enter image description here

+0

你是怎麼它是不同的顏色?我可以爲這些顏色添加一個圖例? – sontek