Reputation: 154
Got this error while creating a new dataframe. Example:
df = pd.DataFrame({'type': 20, 'status': 'good', 'info': 'text'},
index=[0])
Out[0]: TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type
I tried also pass index with quotation marks but it didn't work either.
Numpy version:
np.__version__
Out[1]: '1.20.1'
Thank you for any assistance.
Upvotes: 0
Views: 790
Reputation: 73
I've just checked your code in my environment and it works ok.
I assume your Pandas lib might be outdated.
Here is the related github issue: https://github.com/numpy/numpy/issues/18355
Thanks!
Upvotes: 1