Skip to content

Instantly share code, notes, and snippets.

@BinarySpoon
Last active October 23, 2020 10:08
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 BinarySpoon/1b19b64d12fb73335177370e15542d76 to your computer and use it in GitHub Desktop.
Save BinarySpoon/1b19b64d12fb73335177370e15542d76 to your computer and use it in GitHub Desktop.
# get recession bottom -->
def get_recession_bottom():
#get recession timeframe -->
startQ = get_recession_start()
endQ = get_recession_end()
data = pd.read_excel('gdplev.xls',skiprows=219)
data = data.rename(columns={data.columns[4]:'Quaters',data.columns[6]:'GDP'})
data.set_index('Quaters',inplace=1)
data.sort_index(axis=0,inplace=1)
# sort in ascending order -->
data = data[(data.index > startQ) & (data.index < endQ)]
data.sort_values('GDP',ascending=1,inplace=1)
return data.index[0]
get_recession_bottom()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment