Jun-13-2019, 06:25 PM
for i,r in checkout.iterrows(): ind = -1 f = cleaned[cleaned['atime'].isnull()] if f is not None: f = f[f['date']==r['date']] if f is not None: f = f[f['dtime']<r['atime']] if (f is not None) & (len(f)>0): ind = f.index[0] if ind is not None: cleaned.iloc[ind][['atime','arrival','cost']] = r[['atime','arrival','cost']] #lower three lines combined into one above #cleaned.iloc[ind]['atime'] = r['atime'] #cleaned.iloc[ind]['arrival'] = r['arrival'] #cleaned.iloc[ind]['cost'] = r['cost']Updated the dataframe - although with iterations...