Created
August 15, 2019 12:39
-
-
Save yuyasugano/0a53043bd26e217e550832c690a487e9 to your computer and use it in GitHub Desktop.
Seaborn Sample drawing with data of python-bitbankcc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import pandas as pd | |
import seaborn as sns | |
import python_bitbankcc | |
# Ticker information | |
def get_btc(obj): | |
ret = obj.get_ticker('btc_jpy') | |
return ret | |
# Depth board information | |
def get_btcd(obj): | |
ret = obj.get_depth('btc_jpy') | |
return ret | |
pub = python_bitbankcc.public() | |
depth = get_btcd(pub) | |
asks = depth["asks"] | |
bids = depth["bids"] | |
ask_p, ask_q, bid_p, bid_q = [],[],[],[] | |
for i in asks: | |
ask_p.append(float(i[0])) | |
ask_q.append(float(i[1])) | |
for j in bids: | |
bid_p.append(float(j[0])) | |
bid_q.append(float(j[1])) | |
df_a = pd.DataFrame({'ask_p': ask_p, 'ask_q': ask_q}) | |
df_b = pd.DataFrame({'bid_p': bid_p, 'bid_q': bid_q}) | |
df_c = pd.DataFrame({'ask_p': ask_p, 'ask_q': ask_q, 'bid_p': bid_p, 'bid_q': bid_q}) | |
sns.pairplot(df_a) | |
sns.pairplot(df_b) | |
sns.pairplot(df_c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment