File size: 5,114 Bytes
2b91026
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
{
  "query_fund_Manager(Manager_name: str) -> pd.DataFrame:\n": "# 输出包括基金经理管理的每只基金的代码fund_code,公告日期ann_date,基金经理名字name,性别gender,出生年份birth_year,学历edu,国籍nationality,开始管理日期begin_date,结束日期end_date,简历resume\n    \"\"\"\n        Retrieves information about a fund manager.\n\n        Args:\n            Manager_name (str): The name of the fund manager.\n\n        Returns:\n            df (DataFrame): A DataFrame containing the fund manager's information, including the fund codes, announcement dates,\n                            manager's name, gender, birth year, education, nationality, start and end dates of managing funds,\n                            and the manager's resume. \n    \"\"\"",
  "query_fund_name_or_code(fund_name: str = '', fund_code: str = '') -> str:\n": "# 输入是基金名称或者基金代码, 输出是基金名称或者基金代码,两者不可同时输入\n    \"\"\"\n        Retrieves the fund code based on the fund name or Retrieves the fund name based on the fund code.\n\n        Args:\n            fund_name (str, optional): Fund name. Defaults to ''.\n            fund_code (str, optional): Fund code. Defaults to ''.\n\n        Returns:\n            code or name: Fund code if fund_name is provided and fund_code is empty. Fund name if fund_code is provided and fund_name is empty.\n        \"\"\"",
  "query_fund_data(fund_code: str = '', start_date: str = '', end_date: str = '') -> pd.DataFrame:\n": "# 输出是一份基金数据的dataframe,包括以下信息:\n    # ts_code\tstr\tY\tTS代码 # ann_date\tstr\tY\t公告日期 # nav_date\tstr\tY\t净值日期 # unit_nav\tfloat\tY\t单位净值 # accum_nav\tfloat\tY\t累计净值\n    # accum_div\tfloat\tY\t累计分红 # net_asset\tfloat\tY\t资产净值 # total_netasset\tfloat\tY\t合计资产净值 # adj_nav\tfloat\tY\t复权单位净值\n    \"\"\"\n        Retrieves fund data based on the fund code, start date, and end date.\n\n        Args:\n            fund_code (str, optional): Fund code. Defaults to ''.\n            start_date (str, optional): Start date in YYYYMMDD format. Defaults to ''.\n            end_date (str, optional): End date in YYYYMMDD format. Defaults to ''.\n\n        Returns:\n            df (DataFrame): A DataFrame containing fund data, including TS code, announcement date, net asset value date,\n                            unit net asset value, accumulated net asset value, accumulated dividends, net asset value,\n                            total net asset value, adjusted unit net asset value, and fund name. The 'ts_code' column is renamed\n                            to 'fund_code', 'nav_date' is renamed to 'trade_date', and the DataFrame is sorted by the trade date\n                            in ascending order. If the fund code does not exist, None is returned.\n        \"\"\"",

  "calculate_earning_between_two_time(stock_name: str = '', start_date: str = '', end_date: str = '', index: str = 'close') -> float:\n": "\"\"\"\n        Calculates the rate of return for a specified stock between two dates.\n\n        Args:\n        index: The index used to calculate the stock return. The default is 'close' for stock and 'adj_nav' for fund.\n\n      \"\"\"",
  "calculate_stock_index(stock_data: pd.DataFrame, index:str='close') -> pd.DataFrame:\n": "\"\"\"\n        Calculates the rate of return for a specified stock/fund between two dates.\n\n        Args:\n            ts_code\n            start_date\n            end_date\n            index (str): The index used to calculate the stock return, including 'open' and 'close'.\n\n        Returns:\n            float: The rate of return for the specified stock between the two dates.\n    \"\"\"",
  "loop_rank(df: pd.DataFrame,  func: callable, *args, **kwargs) -> pd.DataFrame:\n": "\"\"\"\n        It iteratively applies the given function to each row and get a result using function. It then stores the calculated result in 'new_feature' column.\n\n        Args:\n        df: DataFrame with a single column\n        func : The function to be applied to each row: func(row, *args, **kwargs)\n        *args: Additional positional arguments for `func` function.\n        **kwargs: Additional keyword arguments for `func` function.\n\n        Returns:\n        pd.DataFrame: A output DataFrame with three columns: the constant column, input column, and new_feature column.\n                     The DataFrame is sorted based on the new_feature column in descending order.\n\n        \"\"\"",
  "select_value_by_column(df1:pd.DataFrame, col_name: str = '', row_index: int = -1) -> Union[pd.DataFrame, Any]:\n": "\"\"\"\n        Selects a specific column or a specific value within a DataFrame.\n\n        Args:\n            df1: The input DataFrame.\n            col_name: The name of the column to be selected.\n            row_index: The index of the row to be selected.\n\n        Returns:\n            Union[pd.DataFrame, Any]. row_index=-1: df1[col_name].to_frame() or df1[col_name][row_index]\n    \"\"\""
}