I have a function
def cruise_fun(speed, accl, acmx, dcmx):
count = 0
index = []
for i in range(len(speed.dropna())):
if ((speed[i]>40) & (accl[i]<acmx*0.2) & (accl[i]>dcmx*0.2)):
count +=1
index.append(i)
return count, index
This function is being called in the following statement
cruise_t_all, index_all =cruise_fun(all_data_speed[0], acc_val_all[0], acc_max_all, decc_max_all)
all_data_speed and acc_val_all are two dataframes of 1 column and 38287 rows. acc_max_all and decc_max_all are two float64 values. I have tried to implement solutions provided in stackoverflow as much as I could. I have used both and and &. I can not get around the problem.