Skip to content

Instantly share code, notes, and snippets.

@markcapece
markcapece / frac-diff_sk
Created July 13, 2019 21:18 — forked from skuttruf/frac-diff_sk
Python code for fractional differencing of pandas time series
"""
Python code for fractional differencing of pandas time series
illustrating the concepts of the article "Preserving Memory in Stationary Time Series"
by Simon Kuttruf
While this code is dedicated to the public domain for use without permission, the author disclaims any liability in connection with the use of this code.
"""
import numpy as np
import pandas as pd
@markcapece
markcapece / AlphaQuery.py
Created June 18, 2019 02:27
Script for accessing equity data on AlphaVantage API. Includes endpoint quote, time series, and technical indicator requests. Returns pandas dataframes.
import pandas as pd
import requests
class AlphaQuery(object):
'''Base class to access the AlphaVantage API
Tries to access the AlphaVantage API key in ./API/AlphaVantage.txt
If this file does not exist, key must be provided manually when creating instance
'''
try:
with open('./API/AlphaVantage.txt', 'r') as f: