-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCrypto_Poloniex.py
More file actions
39 lines (31 loc) · 900 Bytes
/
Crypto_Poloniex.py
File metadata and controls
39 lines (31 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Cryptocurrencies: market quotes from Poloniex
Links
* https://poloniex.com/exchange#btc_eth
* https://en.wikipedia.org/wiki/Ethereum
Prepared for Data Bootcamp course at NYU
* http://databootcamp.nyuecon.com/
* https://github.com/NYUDataBootcamp/Materials/Code/Lab
Written by Dave Backus, March 2016
Created with Python 3.5
"""
import sys
import pandas as pd
import matplotlib.pyplot as plt
print('\nPython version: ', sys.version)
print('Pandas version: ', pd.__version__, '\n')
#%%
"""
read json file of quotes
"""
url1 = 'https://poloniex.com/public?command=returnChartData¤cyPair='
url2 = 'BTC_ETH&start=1435699200&end=9999999999&period=14400'
url = url1 + url2
df = pd.read_json(url)
print('\nDataframe dimensions:', df.shape)
print('\nVariables and dtypes:\n', df.dtypes, sep='')
df = df.set_index('date')
#%%
fig, ax = plt.subplots()
df['close'].plot()
ax.set_xlabel('')