Skip to content

Instantly share code, notes, and snippets.

@Nikolaj-K
Last active December 13, 2017 20:14
Show Gist options
  • Save Nikolaj-K/86ae602717a59eceb79b3bf83ea5d96e to your computer and use it in GitHub Desktop.
Save Nikolaj-K/86ae602717a59eceb79b3bf83ea5d96e to your computer and use it in GitHub Desktop.
work with historic crypto market data
'''
git clone
https://github.com/jhogan4288/coinmarketcap-history
python2.7 coinmarketcap_usd_history.py neo 2016-09-09 2017-12-12 > neo.csv
'''
import csv
import matplotlib.pyplot as plt
FILENAME = 'neo.csv'
def show_me(filename):
days = []
closing = []
with open(filename, 'rb') as infile:
rows = csv.reader(infile, delimiter=',')
for i, row in enumerate(rows):
if i > 0:
#days.append(row[0])
price = float(row[4])
#print(price)
closing.append(price)
plt.plot(closing[::-1])#[270:]
plt.xlabel('days')
plt.ylabel('closing prices')
plt.show()
if __name__ == '__main__':
show_me(FILENAME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment