抱歉,如果我仍然是新手,则在第13行出现缩进错误,请帮助我。我已经阅读了很多文章
list1 = []
long = False
count = 0
TVR_count = 0
for 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:
pass
dfLat = pd.DataFrame(list1)
dfLat[['date','channel','product','start_time','end_time','TVR_total']].head(60)
哆啦的时光机
qq_遁去的一_1
相关分类