I need to choose minimum of 'Start_x'
and 'Start_y'
if ['Overlap']=='Overlapped'
otherwise just 'Start_x'
. I wrote below but it is a bit slow. is there a faster way to do this?
df3['Start'] = df3[['Start_x','Start_y','Overlap']].apply
(
lambda x:x[['Start_x','Start_y']].min() if x['Overlap']=='Overlapped'
else x['Start_x'], axis=1
)