GUI上的Indexoutofbounds错误

2024-09-30 04:37:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我和一个朋友在尝试创建一个包含列表中的一系列条目的GUI时,经常收到一个索引越界错误:

df = pandas.DataFrame(columns = list(self.workingData.columns))
ser = selectSpecies.isin(self.workingData["Species"])
for x in range((len(self.workingData.index))):
if(ser.iloc[x]): #Keeps getting index out of bounds error df =    
df.append(self.workingData.iloc[x,:])

我们在ser.iloc[x]上尝试了不同的索引,包括x-1和x+1,但都没有成功。这一错误是如何以及为什么被挑起的


Tags: columnsself目的dataframepandasdf列表index

热门问题