python >= 3.8
pip install -r requirements.txt
or
python3 -m pip install -r requirements.txt
"sfcds":{ "uid":"XXXXX", "pwd":"XXXXX" }
"dbs":{
"smartsdb":{"sf_account":"smu-da",
"warehouse":"dataarts",
"database":"dataartsdb"}
}
"chunk_size":16000
"begin_dt":"2017-12-31"
"end_dt":"2022-12-31"
"trendYears":[2018,2019,2020,2021,2022]
"orgmapfilepath":"OrgMap.xlsx"
"var":"Unrestricted_operating_bottomline"
"limits_winsorized":[0.1, 0.1]
python3 utils.py
or
python utils.py
Pull CDP data from Snowflake
Winsorize the CDP data (df:pandas.DataFrame) using "limits_winsorized" hyperparameter based on the field "var"
create bar plots and save to "savepath" (string) for the field "var"
hue: The bar plots to grouped by with, could be "Sector" or "Size"
style: figure style, options: {"darkgrid", "whitegrid", "dark", "white", "ticks"}
create_OneBarplot(
df=df, # dataset
var='Unrestricted_operating_bottomline', #variable
yr=2020, # year
sz='Small', # size
st='Community', # sector
agg='mean', # method to aggregate mean/median
style='darkgrid',width=0.1,color='orange',alpha=1, #canvas style, bar width, bar color, tranparency 0-1
xlabel_size=30,title_size=30,xticks_size=20 #xlabel size, title size, xticks size
) -> None