Skip to content

geom_bar and stat_summary and faceting causes ignored ValueError warnings #197

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

Closed
TyberiusPrime opened this issue Sep 26, 2018 · 1 comment

Comments

@TyberiusPrime
Copy link
Contributor

TyberiusPrime commented Sep 26, 2018

The following minimal example

import pandas as pd
import plotnine
import patsy
df = pd.DataFrame(patsy.demo_data("a",'b','x','y', 'z'))
p = plotnine.ggplot(df)
p += plotnine.geom_bar(plotnine.aes('a','y'), stat='stat_summary')
p += plotnine.facet_wrap('b')
p.save("test.png")

causes repeated

ValueError                                Traceback (most recent call last)
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long'

Exception ignored in: 'pandas._libs.lib.is_bool_array'
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long'

messages (one per facet/bar combination?)
But does produce the requested file.

Seems to occur in line 221 of stat_summary.py:
merged = summary.merge(unique, on=['group', 'x'])

@TyberiusPrime
Copy link
Contributor Author

Apperantly it's a pandas bug that disappears when upgrading to 0.23.4 from 0.22
Possibly pandas-dev/pandas#17187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants