对pandas数据帧中的行进行平均

时间:2017-08-07 16:01:14

标签: python pandas

    Unnamed: 0  country hemisphere  zone    ID_month    month   crop    variable    diag    non-diag    stability_factor    v1_stability_factor v2_stability_factor v3_stability_factor
0   0   Mexico  Southern    tropical    1   Jan Maize   DV  75  325 0.230769231 0   50  25
67  0   Canada  Northern    temperate   1   Jan Winter Wheat    DV  81.24552083 318.7544792 0.254884327 24.55528427 24.07126611 24.31327519
85  0   Ukraine Northern    temperate   1   Jan Winter Wheat    DV  133.0328009 266.9671991 0.498311408 33.77390206 32.04552044 32.90971125
93  0   India   Northern    temperate   1   Jan Soybean DV  163.9592092 236.0407908 0.694622352 40.33741643 51.85145586 46.09443615
98  0   United States Of America    Northern    temperate   1   Jan Winter Wheat    DV  126.1548643 273.8451357 0.460679588 28.50863898 37.64939577 33.07901737
106 0   China   Northern    temperate   1   Jan Maize   DV  118.6847373 281.3152627 0.421892279 34.69179042 43.85685473 39.27432258
23  0   South Africa    Northern    temperate   1   Jan Maize   DV  139.5177365 260.4822635 0.535613192 54.10327834 43.14757235 48.62542534

在上面的数据框中,我想通过分别对北半球和南半球国家进行平均来添加平均列diag non-diag stability_factor v1_stability_factor v2_stability_factor v3_stability_factor的2行。

0 个答案:

没有答案