-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Description
Histogram through pandas.DataFrame.hist
import pandas as pd
import numpy as np
df = pd.DataFrame({'length': np.random.normal(0, 1, 1000),
'width': np.random.normal(0, 1, 1000),
'a': np.random.randint(0, 2, 1000)})
df.hist(column=['length', 'width'], by='a', figsize=(4, 2))
Problem description
by-column a
plotted along specified columns length
and width
(link). The full problem is described on this stackoverflow post.
Expected Output
Problem vanishes when by-column is non-numeric (link).
Output of pd.show_versions()
INSTALLED VERSIONS
commit : 2cb9652
python : 3.7.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-142-generic
Version : #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.4
numpy : 1.19.2
pytz : 2021.1
dateutil : 2.8.1
pip : 21.1
setuptools : 49.6.0.post20210108
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.14.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : 2021.04.0
fastparquet : None
gcsfs : None
matplotlib : 3.3.4
numexpr : None
odfpy : None
openpyxl : 3.0.5
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.6.2
sqlalchemy : 1.4.11
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : None
numba : None