In [1]:
import pandas as pd
import datetime
import numpy as np
import scipy as sp
import os
import matplotlib.pyplot as plt
import matplotlib
%matplotlib inline
# font = {'size'   : 18}
# matplotlib.rc('font', **font)
matplotlib.rcParams['figure.figsize'] = (12.0, 6.0)
os.chdir("/Users/yulongyang/Envs/btc-analysis/btc-price-analysis")

In [24]:
time_format = "%d/%m/%Y %H:%M:%S"
price_data = pd.read_csv("./data/info-price.txt", header=False, names=["time", "price"], index_col='time',
                         parse_dates=[0], date_parser=lambda x: datetime.datetime.strptime(x, time_format))
tra_data = pd.read_csv("./data/info-transactions.txt", header=False, names=["time", "transaction"], index_col='time',
                       parse_dates=[0], date_parser=lambda x: datetime.datetime.strptime(x, time_format))

In [25]:
data = pd.merge(price_data, tra_data, how="left", left_index=True, right_index=True)
data.head()


Out[25]:
price transaction
time
2013-03-26 18:15:05 78.00000 47247
2013-03-27 18:15:05 88.90000 51993
2013-03-28 18:15:05 93.56701 57170
2013-03-29 18:15:05 89.05000 66205
2013-03-30 18:15:05 90.99999 59787

In [34]:
data.plot(secondary_y="transaction", figsize=(15,7))


Out[34]:
<matplotlib.axes.AxesSubplot at 0x10b011390>

In [28]:
data.corr()


Out[28]:
price transaction
price 1.000000 0.151185
transaction 0.151185 1.000000