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

TypeError: ufunc 'isfinite' not supported for the input types #68

Open
Queely1 opened this issue Dec 21, 2022 · 5 comments
Open

TypeError: ufunc 'isfinite' not supported for the input types #68

Queely1 opened this issue Dec 21, 2022 · 5 comments

Comments

@Queely1
Copy link

Queely1 commented Dec 21, 2022

Good afternoon, after the update, the following error occurred.

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''.

The code worked fine before. Summary and report are also shown, the error appears only when you try to draw a graph.

Rollback to the previous version could not, the error now appears on any versions.
image
image

@WillianFuks
Copy link
Owner

Hi @Queely1 ,

I noticed it yesterday as well and opened an issue for the numpy repository, this is a bug for version 1.24.

Just reinstall previous version:

pip install -U numpy==1.23.4

And things should be back to normal.

They are already working on a fix for this issue so I'm hoping this will be solved soon.

Let me know how this works for you.

@Queely1
Copy link
Author

Queely1 commented Dec 21, 2022

Works, thanks a lot!

@ecarruda
Copy link

It is also breaking float64 types:

SingleBlockManager
Items: Float64Index([ -2.408224685280692, -2.3739711708557603, -2.3397176564308286,
               -2.305464142005897,  -2.271210627580966,  -2.236957113156034,
              -2.2027035987311026,  -2.168450084306171, -2.1341965698812393,
              -2.0999430554563077,
              ...
                4.099943055456308,   4.134196569881238,   4.168450084306171,
                4.202703598731102,   4.236957113156034,   4.271210627580965,
                4.305464142005897,   4.339717656430828,   4.373971170855761,
               4.4082246852806914],
             dtype='float64', length=200)
NumericBlock: 200 dtype: float64
  res = masked_where(~(np.isfinite(getdata(a))), a, copy=copy)

E 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''

@WillianFuks
Copy link
Owner

WillianFuks commented Dec 21, 2022

Hi @ecarruda ,

Just to confirm, is it still breaking after downgrading the numpy version?

@waral
Copy link

waral commented Dec 23, 2022

Hi,

I just ran into the same issue and using .values when plotting confidence intervals, e.g.:

ax.fill_between(
            pre_post_index[1:],
            inferences['complete_preds_lower'].iloc[1:].values,
            inferences['complete_preds_upper'].iloc[1:].values,
            color=color,
            alpha=0.4
)

seems to solve the issue without downgrading the numpy version.

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

No branches or pull requests

4 participants