Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created September 4, 2019 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aravindpai/17e40e9cd9778322161f59fff078e3a7 to your computer and use it in GitHub Desktop.
Save aravindpai/17e40e9cd9778322161f59fff078e3a7 to your computer and use it in GitHub Desktop.
temp=[]
i=0
j=0
n=len(df) - 2
m=len(df) - 1
while(i<=n):
j=i+1
 while(j<=m):
if(df['end'][i] == df['start'][j]):
df.loc[i,'end'] = df.loc[j,'end']
     temp.append(j)
     j=j+1
   else:
i=j
     break  
df.drop(temp,axis=0,inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment