top_n_assets
Description
This method identifies and returns the top n
performing assets based on their returns within a specified period. It outputs a DataFrame listing these top assets along with their returns and entity names, sorted in descending order by their returns.
Parameters
position
(str): The specific model name.n
(int): The number of assets with the highest returns to be returned.start
(int, optional): The start date of the target period, inYYYYMMDD
format.end
(int, optional): The end date of the target period, inYYYYMMDD
format.
Returns
pandas.DataFrame
: A DataFrame listing the topn
assets with their returns and entity names, sorted by returns in descending order.
Example
Last updated