Python Forum
help on pandas circular import
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help on pandas circular import
#1
hi

i try to test this basic code but i have the message AttributeError: partially initialized module 'pandas' has no attribute 'Series' (most likely due to a circular import)
import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a)

print(myvar)
what is wrong please??
Reply
#2
See if you have name i file pandas.py then rename of delete it.
import pandas as pd

a = [1, 7, 2]
myvar = pd.Series(a)
print(myvar)
Output:
0 1 1 7 2 2 dtype: int64
See that pandas has a placement in site-packages folder.
>>> import pandas
>>> 
>>> pandas.Series
<class 'pandas.core.series.Series'>
>>> pandas.__file__
'C:\\Python39\\lib\\site-packages\\pandas\\__init__.py'
Reply
#3
(May-18-2021, 11:50 AM)snippsat Wrote: See if you have name i file pandas.py then rename of delete it.
import pandas as pd

a = [1, 7, 2]
myvar = pd.Series(a)
print(myvar)
Output:
0 1 1 7 2 2 dtype: int64
See that pandas has a placement in site-packages folder.
>>> import pandas
>>> 
>>> pandas.Series
<class 'pandas.core.series.Series'>
>>> pandas.__file__
'C:\\Python39\\lib\\site-packages\\pandas\\__init__.py'

correct, thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  can not import anaconda pandas module. PySpark pandas module is imported!! aupres 0 723 Aug-06-2023, 01:09 AM
Last Post: aupres
  Plot a pandas data fram via pyqtgraph with an modul import and qt designer widget Nietzsche 0 851 May-29-2023, 02:42 PM
Last Post: Nietzsche
  Illegal instruction (core dumped) when import pandas. amandacstr 1 2,111 Dec-31-2022, 11:31 PM
Last Post: stevendaprano
  What is a circular import? asked by a newbie of newbies ineuw 1 962 Sep-16-2022, 07:27 PM
Last Post: Gribouillis
  Circular Import Led_Zeppelin 3 2,658 Jul-14-2021, 07:41 PM
Last Post: snippsat
  Circular import dependency hobbyist 9 3,852 Feb-23-2021, 11:57 AM
Last Post: Gribouillis
  Can't import pandas j_cooper9 1 2,010 Aug-02-2020, 08:31 PM
Last Post: Larz60+
  CSV import by Pandas maryam88 3 4,226 May-17-2020, 07:33 PM
Last Post: snippsat
  Robot Stay Inside Circular Ring webmanoffesto 4 6,686 Dec-07-2016, 06:57 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020