抱歉,如果我仍然是新手,则在第13行出现缩进错误,请帮助我。我已经阅读了很多文章list1 = []long = Falsecount = 0TVR_count = 0for i in range(0,len(df1Lat)): for j in range(0, len(df_ANTV)): if (df1Lat.start_time.values[i][0:5] == df_ANTV.daypart_variable.values[j][0:5]): if (df1Lat.end_time.values[i][0:5] == df_ANTV.daypart_variable.values[j][0:5]): df1Lat.TVR_total = df_ANTV.TVR.values[j]; list1.append(df1Lat.iloc[i]; else: long = True count += 1 elif (long == True): count += 1 TVR_count += df_ANTV.TVR.values[j] if ((str(df1Lat.end_time.values[i])[0:5]) == (str(df_ANTV.daypart_variable.values[j])[0:5])): long = False df1Lat.TVR_total = TVR_count/count list1.append(df1Lat.iloc[i]) count = 0 TVR_count=0 else: passdfLat = pd.DataFrame(list1)dfLat[['date','channel','product','start_time','end_time','TVR_total']].head(60)
2 回答
哆啦的时光机
TA贡献1779条经验 获得超6个赞
您忘记了此行的右括号,请用以下内容list1.append(df1Lat.iloc[i];
替换它:list1.append(df1Lat.iloc[i])
添加回答
举报
0/150
提交
取消