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.

Amarpreet Singh
  • 227
  • 2
  • 11
  • 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. – Simas Apr 21 '21 at 09:31
  • 1
    yeah found the solution. Just go to algorithms.py and replace np.isnan to pd.isna. – Amarpreet Singh Apr 21 '21 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) – Simas Apr 21 '21 at 12:44

1 Answers1

1

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

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

Amarpreet Singh
  • 227
  • 2
  • 11