-
-
Save BinarySpoon/1b19b64d12fb73335177370e15542d76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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