In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import settings
import utils
import get_data
%matplotlib inline
p = sns.color_palette()
API: http://bitcoincharts.com/charts
period = ['1-min', '5-min', '15-min', '30-min', 'Hourly', '2-hour', '6-hour', '12-hour', 'Daily', 'Weekly']
market = ['coincheckJPY', 'krakenEUR', 'bitstampUSD', 'okcoinCNY', 'btcnCNY', 'krakenUSD', 'itbitUSD', 'bitbayPLN', 'btcoidIDR', 'localbtcRUB', 'localbtcGBP', 'btcdeEUR', 'coinfloorGBP', 'localbtcUSD']
In [2]:
# get_data.get('data/datas.csv', period='6-hour', market='bitstampUSD')
In [3]:
df = pd.read_csv('data/datas.csv', sep=',')
In [4]:
print('Number of rows: {}, Number of columns: {}'.format(*df.shape))
In [4]:
df.head(20)
Out[4]:
In [5]:
df.describe()
Out[5]:
Drop rows with 0.00 values
In [6]:
df = utils.dropna(df)
In [7]:
print('Number of rows: {}, Number of columns: {}'.format(*df.shape))
In [8]:
df.head(20)
Out[8]:
In [9]:
df.describe()
Out[9]:
In [10]:
y = df['Close'].values
plt.hist(df.Close, bins=50, color=p[1])
plt.xlabel('Target Value')
plt.ylabel('Count')
plt.title('Distribution of target value')
print('Target value min {0:.3f} max {1:.3f} mean {2:.3f} std {3:.3f}'.format(np.min(y), np.max(y), np.mean(y), np.std(y)))
In [11]:
plt.figure()
plt.plot(df.index.tolist(), df.Close.values)
plt.title("Historical Value Close Bitcoin")
plt.xlabel('Day')
plt.ylabel('Bitcoin Value')
plt.show()
In [12]:
aux = 0
while True:
plt.figure()
plt.plot(df.loc[aux:aux+100].index.tolist(), df.loc[aux:aux+100].Close.values)
plt.title("Historical Value Close Bitcoin")
plt.xlabel('Day')
plt.ylabel('Bitcoin Value')
plt.show()
aux += 100
if aux > df.shape[0]:
break
In [ ]:
In [ ]: