Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jingwei Li ljw-612

🎯
Focusing
  • Duke Kunshan Univeristy
View GitHub Profile
View DataDescriptor_p2
# 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()
View DataDescriptor_p3
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