Skip to content

Instantly share code, notes, and snippets.

View ljw-612's full-sized avatar
🎯
Focusing

Jingwei Li ljw-612

🎯
Focusing
  • Duke Univeristy
View GitHub Profile
# Install the API package
!pip install coinmetrics-api-client
# Import necessary packages
import pandas as pd
from coinmetrics.api_client import CoinMetricsClient
from os import environ
# Create a client use the community API key
client = CoinMetricsClient()
buy_side_df = trades_df[trades_df['side']=='buy']
sell_side_df = trades_df[trades_df['side']=='sell']
buy_side_df['price'] = buy_side_df['price'].astype('float')
buy_side_df['amount'] = buy_side_df['amount'].astype('float')
sell_side_df['price'] = sell_side_df['price'].astype('float')
sell_side_df['amount'] = sell_side_df['amount'].astype('float')
import matplotlib.pyplot as plt