0

I was importing pandas in jupyter notebook but it gives an error stating that module 'pandas' has no attribute 'compat'

here my code snippet

import pandas as pd

and this is the error I got while importing

AttributeError Traceback (most recent call last) in ----> 1 import pandas as pd

~\Anaconda3\lib\site-packages\pandas__init__.py in 194 # GH 27101 195 # TODO: remove Panel compat in 1.0 --> 196 if pandas.compat.PY37: 197 198 def getattr(name):

AttributeError: module 'pandas' has no attribute 'compat'

How to solve this, guys

brian-brazil
  • 31,678
  • 6
  • 93
  • 86
Darkstar Dream
  • 1,649
  • 1
  • 12
  • 23

2 Answers2

0

Could be that your packages are conflicting.

Perhaps try

conda upgrade --all -y

Gabriel
  • 438
  • 1
  • 5
  • 16
0

1ST METHOD

Go to anaconda navigator and install the pandas module

2ND METHOD

Type pip install pandas in anaconda prompt later you will run pandas in the script you will succeed

Nandu Raj
  • 2,072
  • 9
  • 20