Code
source("../_globals.r")
source("../_globals.r")
= ["#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7"]
cb_palette
from IPython.display import Markdown
def disp(df, floatfmt='g', include_index=True):
return Markdown(
df.to_markdown(=floatfmt,
floatfmt=include_index
index
)
)
def summary_to_df(summary_obj, corner_col = ''):
= pd.DataFrame(summary_obj.tables[1].data)
reg_df = reg_df.iloc[0]
reg_df.columns = reg_df.iloc[1:].copy()
reg_df # Save index col
= reg_df['']
index_col # Drop for now, so it's all numeric
=[''], inplace=True)
reg_df.drop(columns= reg_df.apply(pd.to_numeric)
reg_df = lambda x: round(x, 2)
my_round = reg_df.apply(my_round)
reg_df = reg_df.columns
numeric_cols # Add index col back in
=0, column=corner_col, value=index_col)
reg_df.insert(loc# Sigh. Have to escape | characters?
= [c.replace("|","\|") for c in reg_df.columns]
reg_df.columns return reg_df
Each node
(But we might have the opposite result for a marine economist… rly makes u think )↩︎
If you’re in my DSAN5100 class, then you already know this! If not, check out the MLE slides here for more details↩︎