Aar*_* M. 2 python plot matplotlib pandas
嗨,我有一个熊猫数据框,看起来像
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
Run Code Online (Sandbox Code Playgroud)
我想用wFlow列定义的每一行来绘制aContent列与DO Difference列(x = aContent,y = DO Difference,4条不同的行,每个wFlow一条。
谢谢!
您可以pivot使用pandas.dataframe.plot以下数据并使用:
df.pivot(index='aContent',columns='wFlow',values='DO Difference').plot()
Run Code Online (Sandbox Code Playgroud)