Kerry Back
import pandas as pd
import pymssql
from sqlalchemy import create_engine
server = 'fs.rice.edu'
database = 'stocks'
username = 'stocks'
password = '6LAZH1'
string = "mssql+pymssql://" + username + ":" + password + "@" + server + "/" + database
conn = create_engine(string).connect()
df = pd.read_sql("select * from ghz", conn)
df = df.dropna().set_index("ticker")
Apply any cross-sectional transformations to the entire dataframe. E.g., change
to
Define industries using:
Use the loaded model (or pipeline) and the current features (possibly including industry) to make predictions as