Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hkailee/a1b5ef5289697fc78fc5a2b88760ea28 to your computer and use it in GitHub Desktop.
Save hkailee/a1b5ef5289697fc78fc5a2b88760ea28 to your computer and use it in GitHub Desktop.
Loading adata and preprocessing for CharacterizingOutperformedCompanies1MonthPostCOVID19VaccineSuccess
# Loading pandas dataframe as anndata
adata = qp.AnnData(df_fundamental_logreturn_minmax[ls_fundamental_target])
# Saving raw data for visualization later
adata.raw = adata
# log(x+1) transformation for all data
qp.pp.log1p(adata)
# Standardization scaling per feature
qp.pp.scale(adata)
# add a new `.obs` column for all companies called `GICS_Sector`
adata.obs['GICS_Sector'] = df_fundamental_logreturn['GICS Sector'].values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment