Guest User

Untitled

a guest
Nov 19th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #Creates a empty dataframe
  2. dataset0514maxrec = pd.DataFrame(columns=dataset0514max.columns.values)
  3. dataset0514maxrec.index.name = 'Date'
  4.  
  5. #Gets the unique values, find the groups, recover the max value and append it
  6. for i in dataset0514max.index.unique():
  7. tempDF1 = dataset0514max.loc[dataset0514max.index.isin([i])]
  8. tempDF2 = tempDF1[tempDF1['Data_Value'] == tempDF1['Data_Value'].max()]
  9. dataset0514maxrec = dataset0514maxrec.append(tempDF2.head(1))
  10.  
  11. print(dataset0514maxrec)
Add Comment
Please, Sign In to add comment