aeturrell/skimpy

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

tian2992 opened this issue · 1 comments

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

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.