[英]AttributeError: partially initialized module 'pandas' has no attribute 'read_csv' (most likely due to a circular import). How do I fix it?
AttributeError: partially initialized module 'pandas' has no attribute 'read_csv' (most likely due to a circular import) AttributeError:部分初始化的模块“pandas”没有属性“read_csv”(很可能是由于循环导入)
I get the above error when I run the below code运行以下代码时出现上述错误
import time
import os
import pandas
while True :
if os.path.exists("files/temps_today.csv") :
data= pandas.read_csv("files/temps_today.csv")
print(data.mean())
else :
print("File does not exist.")
time.sleep(10)
If you have a file named csv.py or pandas.py or some other dependency in the current directory, that can cause an error like this.如果您在当前目录中有一个名为 csv.py 或 pandas.py 或其他一些依赖项的文件,则可能会导致这样的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.