0

I'm facing TypeError while using pandas-profiling on a data as follows:

Summarize dataset: 2% 1/59 [00:09<09:20, 9.66s/it, Describe variable:project] -->>

~\Anaconda3\lib\site-packages\pandas\core\algorithms.py in isin(comps, values)
    441         # If the the values include nan we need to check for nan explicitly
    442         # since np.nan it not equal to np.nan
--> 443         if np.isnan(values).any():
    444             f = lambda c, v: np.logical_or(np.in1d(c, v), np.isnan(c))
    445         else:

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

Please help. I have no idea what this is about.

3
  • Have you found solutions to this maybe? Having the same error. Only worked when passing dataframe with dropped nan values, but then it misses a lot of values. Have tried changing dtypes for all the columns, tried filling the nan values, tried replacing 'None','Null','NaN','nan' values with np.nan. Nothing helped. Commented Apr 21, 2021 at 9:31
  • 1
    yeah found the solution. Just go to algorithms.py and replace np.isnan to pd.isna. Commented Apr 21, 2021 at 10:08
  • 1
    Thank you! It worked! (P.S. to anyone coming around: don't name your file pandas_profiling.py as circular reference error will be thrown) Commented Apr 21, 2021 at 12:44

1 Answer 1

1

Got it resolved myself. Check out the Pandas-Profiling Github page:

https://github.com/pandas-profiling/pandas-profiling/issues/752#issuecomment-815462226

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.