Getting TypeError while parsing a dataframe
See original GitHub issueI’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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top Results From Across the Web
Getting TypeError while parsing a dataframe into Pandas ...
Getting TypeError while parsing a dataframe into Pandas Profiling library ... I'm facing TypeError while using pandas-profiling on a data as ...
Read more >Getting TypeError while parsing a dataframe #752 - GitHub
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, ...
Read more >[Solved]-Getting TypeError while parsing a dataframe into Pandas ...
Coding example for the question Getting TypeError while parsing a dataframe into Pandas Profiling library-Pandas,Python.
Read more >What's new in 2.0.0 (??) - Pandas
With the new behavior, we get exactly the requested dtype: ... As of version 2.0.0, parsing will use a consistent format, determined by...
Read more >TypeError expected string or bytes-like object - STechies
This is usually encountered when a function that you are using or have defined is fed an integer or float. It might be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I checked out the pandas source and found the root cause: Here is where that 1 million threshold is coming from, and in the version of pandas I’m using (
1.1.3
) checks this withnp.isnan
instead ofnp.isna
; as the OP mentioned above,np.isna
is the more robust check.pandas==1.1.4
+ includes this fix and resolves the issue for me.Here’s a snippet of what I’m using (Spark but converted to pandas):