0

I have install pandas , but when i import pandas and run any code in my vs code comes with this error

"AttributeError: partially initialized module 'pandas' has no attribute 'DataFrame' (most likely due to a circular import)".

help me to solve this.

I have tried many times with correct code and source. its should run the program correctly, but it shows error...

import pandas

mydataset = {
  'cars': ["BMW", "Volvo", "Ford"],
  'passings': [3, 7, 2]
}

myvar = pandas.DataFrame(mydataset)

print(myvar)

2 Answers2

0

This problem must be related to the installation of pandas or pip

make sure you have pandas installed by running:

pip install pandas
Lars K.
  • 59
  • 4
0

I just got my solution:- There is two major reason to come this error:

  1. Don't download panda by pip install panda because there is diff. between panda and pandas, so download pandas module/source by pip install pandas.

  2. Don't Save your file by name with pandas.py