{ "get_stock_prices_data(stock_name: str='', start_date: str='', end_date: str='',freq:str='daily') -> pd.DataFrame:\n": "\"\"\"\n Retrieves the daily/weekly/monthly price data for a given stock name during a specific time period.\n Args:\n - start_date(end_date): The start and end date in format 'YYYYMMDD'.\n - freq: The frequency: 'daily', 'weekly', or 'monthly'.\n\n Returns:\n - pd.DataFrame: A dataframe that contains the many price columns including stock_code, trade_date, open, high, low, close, pre_close(昨天收盘价), change(涨跌额), pct_chg(涨跌幅),vol(成交量),amount(成交额)\n \"\"\"", "get_stock_technical_data(stock_name: str, start_date: str, end_date: str) -> pd.DataFrame:\n": "\"\"\"\n Retrieves the daily technical indicator of a stock including macd turnover rate, volume, pe-ttm, etc. Those technical indicators are usually plotted as subplots in a k-line chart.\n\n Returns:\n pd.DataFrame: A DataFrame containing the columns: ts_code, trade_date, close, and many technical indicators\n. \"\"\"", "get_index_data(index_name: str = '', start_date: str = '', end_date: str = '', freq: str = 'daily') -> pd.DataFrame:\n": "\"\"\"\n This function retrieves daily, weekly, or monthly data for a given stock index.\n\n Arguments:\n - index_name: Name of the index\n - freq: Frequency 'daily', 'weekly', or 'monthly'\n\n \"\"\"", "get_index_constituent(index_name:str='',start_date:str ='',end_date:str ='') -> pd.DataFrame:\n": "\"\"\"\n Query the constituent stocks of basic index (中证500) or a specified SW (申万) industry index\n\n return:\n A pandas DataFrame containing the following columns:\n index_code\n index_name\n stock_code: the code of the constituent stock.\n stock_name: \n weight: the weight of the constituent stock.\n \"\"\"", "get_Financial_data_from_time_range(stock_name:str, start_date:str, end_date:str, financial_index:str='') -> pd.DataFrame:\n": "#查询财报数据,每年有四个财报\"yyyy0331\"为一季报,\"yyyy0630\"为半年报,\"yyyy0930\"为三季报,\"yyyy1231\"为年报,不能获取pe-ttm,pb等技术指标. 例如查询某段时间内所有财报:get_Financial_data_from_time_range('20190101','20221231',roe')返回2019年到2022整三年12份财报里的roe数据\n 例如查询某一期财报:get_Financial_data_from_time_range(\"600519.SH\", \"20190331\", \"20190331\", \"roe\").代表查询2019年一季报中roe数据\n financial_index: The financial indicator:ROE, netprofit_yoy .\n\n\"\"\"", "calculate_stock_index(stock_data: pd.DataFrame, index:str='close') -> pd.DataFrame:\n": "\"\"\"\n Select or Calculate a index for a stock from source dataframe.\n\n Index : The index could be price indicator: \"close\", \"pct_chg\" or technical indicator: \"pe-ttm\" or \"Cumulative_Earnings_Rate\" and \"candle_K\" \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 \"\"\"", "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 and sorted the 'new_feature' column in descending order.\n\n args: The input DataFrame only have a single column\n func : The function to be applied to each row: func(row, *args, **kwargs)\n *args and **kwargs: arguments for `func` function.\n Returns:\n A output DataFrame with three columns: the constant column, input column, and new_feature column.\n\n \"\"\"", "merge_indicator_for_same_stock(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:\n": "\"\"\"\n Merges two DataFrames (two indicators of the same stock). Data of two different stocks cannot be merged. \n\n Args:\n df1: DataFrame contains some indicators for stock A.\n df2: DataFrame contains other indicators for stock A.\n\n Returns:\n pd.DataFrame: The merged DataFrame contains two different indicators.\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 col_name: The name of the column to be selected.\n row_index: The index of the row to be selected.\n\n row_index=-1: df1[col_name].to_frame() or df1[col_name][row_index]\n \"\"\"" }