2017-04-27 109 views
2

您好我有一個熊貓數據框,看起來像熊貓繪圖與系列兩列在第三列值定義

deflector wFlow aContent DO Difference 
64   3 127.5  10  2.007395 
65   3 127.5   3  1.163951 
66   3 127.5   5  1.451337 
67   3 127.5   7  1.535639 
68   3 24.0  10  1.046328 
69   3 24.0   3  0.854763 
70   3 24.0   5  0.766780 
71   3 24.0   7  0.905270 
72   3 56.0  10  1.274954 
73   3 56.0   3  1.298657 
74   3 56.0   5  1.049621 
75   3 56.0   7  1.004255 
76   3 88.0  10  1.194174 
77   3 88.0   3  1.056968 
78   3 88.0   5  1.066173 
79   3 88.0   7  1.097231 

我想繪製aContent列VS每條線的DO差列由定義wFlow柱(X = aContent,Y = DO差異,4條不同的線,一個用於每個wFlow

由於

+0

歡迎StackOverflow上。請閱讀並遵守幫助文檔中的發佈準則。 (https://stackoverflow.com/help/mcve)適用最小,完整,可驗證的示例。在發佈您的MCVE代碼並準確描述問題之前,我們無法爲您提供有效的幫助。 StackOverflow不是一個編碼或教程服務。另外,添加你嘗試過的? –

回答

4

可以pivot的數據並使用pandas.dataframe.plot:!

df.pivot(index='aContent',columns='wFlow',values='DO Difference').plot() 

enter image description here