TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type
See original GitHub issueReproducing code example:
import numpy as np
<< your code here >>
import numpy as np
import pandas as pd
df=pd.read_csv('link')
df.info() and df.describe() gives error as "TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type" and also plotting(df.plot()) gives same error.
Error message:
NumPy/Python version information:
Issue Analytics
- State:
- Created 3 years ago
- Comments:29 (9 by maintainers)
Top Results From Across the Web
How to treat '<attribute 'dtype' of 'numpy.generic' objects>' error?
I got the error: TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type. This is how i fixed it.
Read more >TypeError: Cannot interpret '4' as a data type error [Solved]
The "TypeError: Cannot interpret '4' as a data type" occurs when we pass an integer instead of a data type as the second...
Read more >Python not recognize data type of dataframe for plotting - Reddit
TypeError : Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type. Why might this error be occurring and how might ...
Read more >How to treat '<attribute 'dtype' of 'numpy.generic' objects>' error?
After installing pypfopt and u-numpy, dataframe.info() command shows this error. TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.
Read more >Frequently asked questions (FAQ) - miRge3.0 - Read the Docs
TypeError : Cannot interpret <attribute 'dtype' of 'numpy.generic' objects> as a data type; UnsatisfiableError: bowtie=1.3.0 -> libgcc-ng[version='>=9.3.0'] -> ...
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
There is a unfortuate incompatibility with old pandas and 1.20. Updating pandas to a newer version should fix it, see also https://github.com/pandas-dev/pandas/issues/39520#issuecomment-772630011
Updating to
pandas>=1.0.5should solve it. Supposedly alsopandas==0.25.3works. If you are stuck with pandas 0.24.x you may not be able to usse numpy 1.20.x though, unfortunaly. In that case, use numpy<1.20,Hey sorry for disappearing, but you were totally right. For some reason the Conda environment was using the pandas from within the env, but the numpy from outside, causing the conflict. We ended up just downgrading the numpy from outside the env to match the one within the env and everything is happy now. Thank you so much!