-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: weights
is not working for multiple columns in df.plot.hist
#33440
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
Conversation
pandas/tests/plotting/test_frame.py
Outdated
df2 = pd.DataFrame(dict(zip(["A", "B"], 0.1 * np.random.randn(2, 100,)))) | ||
ax2 = _check_plot_works(df2.plot, kind="hist") | ||
|
||
self._check_data(ax1, ax2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way in the test to check that the weights are appropriately rendered by column?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for taking a look! @WillAyd
good point, i slightly changed the test, and i think: in order to check weights to be rendered appropriately, we could use height
in rectangle patches because histogram is essentially rectangles. therefore, for instance, weights for all is 0.1
as in original example, the height of plot should be 0.1
times of original one without weights.
what do you think of this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
thanks @charlesdong1991 |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff