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

geom_ribbon and geom_smooth problems #654

Closed
laurivil opened this issue Dec 20, 2022 · 6 comments
Closed

geom_ribbon and geom_smooth problems #654

laurivil opened this issue Dec 20, 2022 · 6 comments

Comments

@laurivil
Copy link

I've previously used geom_ribbon() and geom_smooth() without problems, but now I cannot make my old scripts work. I keep bumping to this:

2357
2358 """
-> 2360 return masked_where(~(np.isfinite(getdata(a))), a, copy=copy)

TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

All data types are correct and no inf or na values are present.

@LoicGrobol
Copy link

This seems to be a regression in numpy 1.24.0. While waiting for a fix, downgrading to 1.23.x should fix the issue.

@laurivil
Copy link
Author

Thanks, solved it!

@LoicGrobol
Copy link

LoicGrobol commented Jan 2, 2023

numpy/numpy#22858 should have fixed it, so this should not be an issue from numpy 1.24.1

@alexkyllo
Copy link

alexkyllo commented May 1, 2023

I'm experiencing this same error message whenever I attempt to combine more than one geom with a date x axis on a time series plot. For example, I can use any of geom_point(), geom_smooth(), or geom_line() by itself, but when I use any two together, I get the TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' error.

I have versions:

numpy==1.24.3
plotnine==0.10.1

Edit: the problem seems to not actually be with the date column, but rather with my y-variable which was an Int64 type. After casting it to a Float64, the error goes away.

@has2k1
Copy link
Owner

has2k1 commented May 2, 2023

I'm experiencing this same error message whenever I attempt to combine more than one geom with a date x axis on a time series plot. For example, I can use any of geom_point(), geom_smooth(), or geom_line() by itself, but when I use any two together, I get the TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' error.

I have versions:

numpy==1.24.3 plotnine==0.10.1

Edit: the problem seems to not actually be with the date column, but rather with my y-variable which was an Int64 type. After casting it to a Float64, the error goes away.

Can you create a separate issue with a minimal reproducible example?

@alexkyllo
Copy link

I'm experiencing this same error message whenever I attempt to combine more than one geom with a date x axis on a time series plot. For example, I can use any of geom_point(), geom_smooth(), or geom_line() by itself, but when I use any two together, I get the TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' error.
I have versions:
numpy==1.24.3 plotnine==0.10.1
Edit: the problem seems to not actually be with the date column, but rather with my y-variable which was an Int64 type. After casting it to a Float64, the error goes away.

Can you create a separate issue with a minimal reproducible example?

Yes, created #683

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

4 participants