Skip to content

Instantly share code, notes, and snippets.

@txthai
Last active July 28, 2016 06:07
Show Gist options
  • Save txthai/f2d9b7236d57195e13d206c7fdacc008 to your computer and use it in GitHub Desktop.
Save txthai/f2d9b7236d57195e13d206c7fdacc008 to your computer and use it in GitHub Desktop.
def save_data(df, directory, ticker_symbol, start_date, end_date, file_extension):
sdt = strip_hyphens(start_date)
edt = strip_hyphens(end_date)
filename = directory + ticker_symbol + '_' + sdt + '-' + edt + file_extension
df.to_csv(filename, index_label="Date")
def strip_hyphens(s):
return s.replace("-", "")
if __name__ == "__main__":
pull_data()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment