Skip to content

Instantly share code, notes, and snippets.

@Sanlap1997
Created October 2, 2020 08: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 Sanlap1997/08cc91984b9998709137d5d754496809 to your computer and use it in GitHub Desktop.
Save Sanlap1997/08cc91984b9998709137d5d754496809 to your computer and use it in GitHub Desktop.
rul = pd.DataFrame(test_df.groupby('id')['cycle'].max()).reset_index()
rul.columns = ['id', 'max']
truth_df.columns = ['more']
truth_df['id'] = truth_df.index + 1
truth_df['max'] = rul['max'] + truth_df['more']
truth_df.drop('more', axis=1, inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment