I am trying to execute a code, but i am getting an error.
import pandas as pd
import numpy as np
pd.Series([1, 2, np.nan, 4], dtype=pd.Int64Dtype())
I expect the output as:
Out[14]:
0 1
1 2
2 NaN
3 4
dtype: Int64
Conclusion # The Python "AttributeError module 'pandas' has no attribute 'DataFrame'" occurs when we have a local file named pandas.py or misspell DataFrame . To solve the error, make sure to rename any local files named pandas.py .
Pandas module runs on top of NumPy and it is popularly used for data science and data analytics. NumPy is a low-level data structure that supports multi-dimensional arrays and a wide range of mathematical array operations.
It might be due to wrong installation or older version as I tried the same and it's working
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With