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

Error on __infer_datatypes due to 'cannot convert NA to integer' #573

Open
tian2992 opened this issue Dec 6, 2023 · 1 comment
Open
Labels
question Further information is requested

Comments

@tian2992
Copy link

tian2992 commented Dec 6, 2023

Running skimpy.skim(df) returns me an error

    662     df = _delete_unsupported_columns(df)
    663     # Perform inference of datatypes
--> 664     df = _infer_datatypes(df)

/python3.9/site-packages/skimpy/__init__.py in _infer_datatypes(df)
    137             continue
    138         # There is no else statement here because logic should never get to this point.
--> 139         df[col[0]] = df[col[0]].astype(data_type)
    140     return df
    141 

I have a bunch of columns so the message does not usefully describe how to fix.

i also cleaned my df (b10_r) with and i still get that error.

for column in b10_r.columns:
    ty = pandas.api.types.infer_dtype(b10_r[column])
    print("{} - {}".format(column, ty))
    if ty in ["mixed-integer", "mixed", "mixed-integer-float", "unknown-array"]:
        kols.append(column)

for k in kols :
    del b10_r[k]

but i still get it

@aeturrell
Copy link
Owner

Hi @tian2992, thanks for this! I'm having trouble replicating this behaviour. Would you be able to post a reprex (reproducible example)? This doesn't need to include your data, it could be with fake data, but if I can tell what data type triggered the error it would help me to fix the bug.

@aeturrell aeturrell added the question Further information is requested label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants