Matplotlib与Pandas:Elementwise比较失败

2024-10-01 15:49:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用pandas和matplotlib构建一个条形图。我需要误差线,但我的函数没有创建它们,我得到以下消息:

C:\Python27\lib\site-packages\matplotlib\collections.py:590: FutureWarning: elementwise comparison failed; returning sca
lar instead, but in the future will perform elementwise comparison
  if self._edgecolors == str('face'):

根据熊猫绘图文件:

^{pr2}$

我有以下内容:

recsFrame_mean = recsFrame.groupby('REGIONC').mean()

recsFrame_mean.plot(y='weighted_KWH',yerr='se_KWH', kind='bar')

recsFrame_-mean具有以下结构:

>>> print(recsFrame_mean)
         DIVISION  REPORTABLE_DOMAIN   TYPEHUQ       NWEIGHT        HDD65  \
REGIONC
1        1.586055           2.734775  2.997793   9166.128420  5894.129303
2        3.595498           9.556806  2.476609   9116.257475  6285.651425
3        5.751589          17.612958  2.558924  10288.546455  2436.917604
4        9.564147          25.390777  2.717060   8615.848474  3067.628294

             ...       PERIODLP   SCALELP  PERIODFO   SCALEFO  PERIODKR  \
REGIONC      ...
1            ...      -1.536187 -1.684025 -0.392763 -0.897617 -1.854810
2            ...      -1.523039 -1.676750 -1.906437 -1.934576 -1.945480
3            ...      -1.528117 -1.679951 -1.945477 -1.963325 -1.951100
4            ...      -1.650485 -1.758322 -1.971221 -1.980583 -1.968793

         SCALEKER   NGHSQFT  ELECHSQFT  weighted_KWH        se_KWH
REGIONC
1       -1.897617  0.402426   5.895109  7.407772e+07   7923.790058
2       -1.962715  0.405440   7.297165  9.647961e+07  11282.706985
3       -1.966259  0.138032  10.506909  1.498108e+08  14699.751866
4       -1.978155  0.299447   7.095108  8.017829e+07   8982.045134

[4 rows x 931 columns]

Tags: 函数消息pandasmatplotlibmeancomparison误差kwh

热门问题