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

Problem filtering data without associated standard deviations #30

Open
bmanubay opened this issue Apr 6, 2016 · 2 comments
Open

Problem filtering data without associated standard deviations #30

bmanubay opened this issue Apr 6, 2016 · 2 comments

Comments

@bmanubay
Copy link
Contributor

bmanubay commented Apr 6, 2016

When trying to filter data by limiting to properties where an associated standard deviation is present (which is a separate column in the pandas dataframe) I get the following error:

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

Not really sure what this means, but it is an issue worth looking into (I think) for the purposes of the OpenFF project.

@kyleabeauchamp
Copy link
Collaborator

It likely means you're calling numpy.isnan() on a column that contains string values, rather than numerical values. See example below:

import pandas as pd
import numpy as np

x = pd.DataFrame([dict(A=1, B=2), dict(A="3", B=4)])

np.isnan(x.A)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-62fa1d22f6fa> in <module>()
----> 1 np.isnan(x.A)

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


np.isnan(x.B)
Out[6]: 
0    False
1    False
Name: B, dtype: bool

@bmanubay
Copy link
Contributor Author

bmanubay commented Apr 6, 2016

That was indeed the case Kyle. It's odd, but some of the columns with no values fill as the string 'nan' rather than the actual data type 'NaN'. Thanks for the input!

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

2 participants