Sort the assets in the cross-section, and form portfolios.
Calculate equity characteristics and returns with codes and wrds.
Run main_sort_20210202.py
You get an object, in the class cs definded in folder ./tools/. The object contains 61 groups of univariate (quintile) sorted portfolios and 60 groups of bivariate (ME2 x Char3) sorted portfolios, where portfolio returns, long-short factors, portfolio characteristics are very convenient to access via the class cs.
A simple example is there in example.ipynb to demonstrate the features in class cs.
./data_Jan2021/ is proprietary data. You can calculate your own equity data with the code in step 1.