Skip to content

Instantly share code, notes, and snippets.

@anthonymorast
Created August 17, 2021 18:56
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 anthonymorast/79da6a9ab8ed32b837a34fefd47272fd to your computer and use it in GitHub Desktop.
Save anthonymorast/79da6a9ab8ed32b837a34fefd47272fd to your computer and use it in GitHub Desktop.
def best_returns_wrt_start_price(data):
data["pct_return_start"] = data["profit"]/data["start_price"]
return data.sort_values(by=["pct_return_start"], ascending=False)[:5] # top 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment