DataFrame (). Round () AttributeError: у объекта 'BlockManager' нет атрибута 'reindex' - PullRequest
1 голос
/ 17 февраля 2020

Я получаю AttributeError: у объекта 'BlockManager' нет атрибута 'reindex', когда я пытаюсь округлить DataFrame. Пожалуйста, смотрите ниже пример:

import pandas as pd


df = pd.DataFrame([(.21, .32), (.01, .67), (.66, .03), (.21, .18)],
              columns=['dogs', 'cats'])
df.round(1)

Результат:

File "<ipython-input-41-7ebbeaa04631>", line 1, in <module>
df.round(1)

  File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\frame.py", line 7458, in round
    concat(new_cols, axis=1), index=self.index, columns=self.columns

  File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\frame.py", line 408, in __init__
    data, axes=dict(index=index, columns=columns), dtype=dtype, copy=copy

  File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\generic.py", line 189, in _init_mgr
    mgr = mgr.reindex(

AttributeError: 'BlockManager' object has no attribute 'reindex'

Есть идеи?

...