Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created September 4, 2019 10:10
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/aa7b4fa3959ffb8eb0445b75a4e45863 to your computer and use it in GitHub Desktop.
Save aravindpai/aa7b4fa3959ffb8eb0445b75a4e45863 to your computer and use it in GitHub Desktop.
import pandas as pd
df=pd.DataFrame(columns=['energy','start','end'])
thresh=12000
row_index=0
for i in range(len(energy)):
value=energy[i]
if(value>=thresh):
i=np.where(energy == value)[0]
   df.loc[row_index,'energy']=value
   df.loc[row_index,'start']=i[0] * 5
   df.loc[row_index,'end']=(i[0]+1) * 5
   row_index= row_index + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment