Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
FROM jupyter/datascience-notebook | |
USER root | |
# Install libssl-dev | |
RUN apt-get update | |
RUN apt-get install libssl-dev -y -q | |
# Install GNU Octave | |
RUN apt-get install octave -y -q |
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
server { | |
listen 80 default_server; | |
access_log /var/log/nginx/placeholder.log; | |
root /etc/nginx/placeholder/; | |
index index.html; | |
server_name _; | |
location / { |
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen 80; | |
# NOTE: replace datarecipe.com with your domain | |
server_name datarecipe.com; | |
return 301 https://$server_name$request_uri; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import pandas_datareader.data as web | |
import datetime | |
def set_variables(): | |
ticker_symbols = ['^GSPC', '^DJI', '^IXIC'] | |
start_date = '2000-01-01' | |
end_date = '2016-06-30' | |
data_source = 'yahoo' | |
directory = './' | |
file_extension = '.csv' |
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
def pull_data(): | |
ticker_symbols, start_date, end_date, data_source, directory, file_extension = set_variables() | |
start = string_to_date_time(start_date) | |
end = string_to_date_time(end_date) | |
for ticker_symbol in ticker_symbols: | |
df = web.DataReader(ticker_symbol, data_source, start, end) | |
save_data(df, directory, ticker_symbol, start_date, end_date, file_extension) | |
def string_to_date_time(s): | |
sy = int(s[:4]) |
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
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__": |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer