Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: df.hist by column alongside with specified columns #41188

Open
SimonKitSangChu opened this issue Apr 27, 2021 · 0 comments
Open

BUG: df.hist by column alongside with specified columns #41188

SimonKitSangChu opened this issue Apr 27, 2021 · 0 comments
Labels

Comments

@SimonKitSangChu
Copy link

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

@SimonKitSangChu SimonKitSangChu added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 27, 2021
@jbrockmendel jbrockmendel added the Visualization plotting label Jun 6, 2021
@mroeschke mroeschke removed the Needs Triage Issue that has not been reviewed by a pandas team member label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants