TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type

See original GitHub issue

Reproducing 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:closed
  • Created 3 years ago
  • Comments:29 (9 by maintainers)

github_iconTop GitHub Comments

30reactions
sebergcommented, Feb 7, 2021

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.5 should solve it. Supposedly also pandas==0.25.3 works. 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,

4reactions
jessdwitchcommented, Feb 10, 2021

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!

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found