0

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.

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

1 Comment

Downgrading numpy solved this problem. Via pip install --upgrade numpy==1.18.1. Do not use numpy 1.20.1 atm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.