I used filter to see which 500 companies are in the "largest 500 companies in terms of market cap". I got the result as True or False. But how can i arrange those companies in descending order?
def make_pipeline():
# Gets the latest market cap.
mkt_cap = morningstar.valuation.market_cap.latest
# Filter for the top 500 securities by market cap.
top_mkt_cap = mkt_cap.top(500)
return Pipeline(
columns={
'top 500': top_mkt_cap
}
)
result = run_pipeline(make_pipeline(), '2016-01-01', '2016-01-01')
result.head()