Created
February 28, 2019 15:09
-
-
Save solalatus/8f90cad209e960ada17c8b62454adf95 to your computer and use it in GitHub Desktop.
This file contains 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
import pandas as pd | |
from sqlalchemy import create_engine | |
... | |
engine = create_engine('postgresql://'+user+':'+password+'@'+host+':'+port+'/'+dbname,echo=False) | |
df_orderbook = pd.read_sql_query('select * from "public_orderbook"',con=engine) | |
df_area_filtered_orders = df_orderbook[df_orderbook['dlvryAreaId']=='10YDE-RWENET---I'] | |
df_contract_orders=df_area_filtered_orders[df_area_filtered_orders['contractId']==11064529] | |
stacked=pd.DataFrame(list(df_contract_orders.BuyOrdrList.apply(pd.Series).stack())) | |
print(stacked.head(100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment