Skip to content

Instantly share code, notes, and snippets.

@evanaze
Created August 21, 2020 16:32
Show Gist options
  • Save evanaze/afec0e2f547222cad6bb67326574ed8b to your computer and use it in GitHub Desktop.
Save evanaze/afec0e2f547222cad6bb67326574ed8b to your computer and use it in GitHub Desktop.
# load the data into a DataFrame and rename the columns
data = pd.DataFrame(response["data"]).rename({0: "date", 1: "volatility", 2: "sharpe"}, axis=1)
# turn the date column into datetime type
data["date"] = pd.to_datetime(data["date"])
# set the date as the index
data.set_index("date", inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment