Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "module 'pandas' has no attribute 'Int64Dtype' " error in python?

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
like image 642
saurabh Avatar asked May 07 '19 08:05

saurabh


People also ask

How do you fix pandas has no attribute DataFrame?

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 .

What is a module in pandas?

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.


1 Answers

It might be due to wrong installation or older version as I tried the same and it's working

like image 159
Anjali Dadhich Avatar answered Sep 24 '22 17:09

Anjali Dadhich