You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be possible to plot a pie chart with categorical values.
Traceback:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/pandas/plotting/_core.py", line 1528, in pie
return self(kind="pie", **kwargs)
File "/usr/lib/python3/dist-packages/pandas/plotting/_core.py", line 949, in __call__
return plot_backend.plot(data, kind=kind, **kwargs)
File "/usr/lib/python3/dist-packages/pandas/plotting/_matplotlib/__init__.py", line 60, in plot
plot_obj = PLOT_CLASSES[kind](data, **kwargs)
File "/usr/lib/python3/dist-packages/pandas/plotting/_matplotlib/core.py", line 1506, in __init__
data = data.fillna(value=0)
File "/usr/lib/python3/dist-packages/pandas/core/series.py", line 4530, in fillna
return super().fillna(
File "/usr/lib/python3/dist-packages/pandas/core/generic.py", line 6061, in fillna
new_data = self._mgr.fillna(
File "/usr/lib/python3/dist-packages/pandas/core/internals/managers.py", line 594, in fillna
return self.apply(
File "/usr/lib/python3/dist-packages/pandas/core/internals/managers.py", line 409, in apply
applied = getattr(b, f)(**kwargs)
File "/usr/lib/python3/dist-packages/pandas/core/internals/blocks.py", line 1779, in fillna
values = values.fillna(value=value, limit=limit)
File "/usr/lib/python3/dist-packages/pandas/core/arrays/categorical.py", line 1721, in fillna
raise ValueError("fill value must be in categories")
ValueError: fill value must be in categories
Expected Output
It should generate pie chart without errors.
Output of pd.show_versions()
INSTALLED VERSIONS
------------------
commit : b5958ee
python : 3.9.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.8.0-50-generic
Version : #56-Ubuntu SMP Mon Apr 12 17:18:36 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
Code Sample, a copy-pastable example
Problem description
It should be possible to plot a pie chart with categorical values.
Traceback:
Expected Output
It should generate pie chart without errors.
Output of
pd.show_versions()
pandas : 1.1.5
numpy : 1.19.5
pytz : 2021.1
dateutil : 2.8.1
pip : 20.3.4
setuptools : 52.0.0
Cython : 0.29.21
pytest : 6.0.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : None
pandas_datareader: None
bs4 : 4.9.3
bottleneck : 1.2.1
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.4
numexpr : 2.7.2
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.6.0
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : None
xlwt : 1.3.0
numba : None
Additional context
Might be linked to #39320 and #32414
The text was updated successfully, but these errors were encountered: