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, in YYYYMMDD format.

  • end (int, optional): The end date of the target period, in YYYYMMDD format.

Returns

  • pandas.DataFrame: A DataFrame listing the top n assets with their returns and entity names, sorted by returns in descending order.

Example

top_asset_df = Evaluator.top_n_assets('ModelName', 5, 20210101, 20211231)

Last updated