code: def indicator_analysis(df, method="mean"):
      """analyze statistical time-series indicators of trading
  
      Parameters
      ----------
      df : pandas.DataFrame
          columns: like ['pa', 'pos', 'ffr', 'deal_amount', 'value'].
              Necessary fields:
                  - 'pa' is the price advantage in trade indicators
                  - 'pos' is the positive rate in trade indicators
                  - 'ffr' is the fulfill rate in trade indicators
              Optional fields:
                  - 'deal_amount' is the total deal deal_amount, only necessary when method is 'amount_weighted'
                  - 'value' is the total trade value, only necessary when method is 'value_weighted'
  
          index: Index(datetime)
      method : str, optional
          statistics method of pa/ffr, by default "mean"
  
          - if method is 'mean', count the mean statistical value of each trade indicator
          - if method is 'amount_weighted', count the deal_amount weighted mean statistical value of each trade indicator
          - if method is 'value_weighted', count the value weighted mean statistical value of each trade indicator
  
          Note: statistics method of pos is always "mean"
  
      Returns
      -------
      pd.DataFrame
          statistical value of each trade indicators
      """
      weights_dict = {
          "mean": df["count"],
          "amount_weighted": df["deal_amount"].abs(),
          "value_weighted": df["value"].abs(),
      }
      if method not in weights_dict:
          raise ValueError(
              f"indicator_analysis method {method} is not supported!"
          )
  
      # statistic pa/ffr indicator
      indicators_df = df[["ffr", "pa"]]
      weights = weights_dict.get(method)
      res = indicators_df.mul(weights, axis=0).sum() / weights.sum()
  
      # statistic pos
      weights = weights_dict.get("mean")
      res.loc["pos"] = df["pos"].mul(weights).sum() / weights.sum()
      res = res.to_frame("value")
      return res
  
file_path: qlib/qlib/contrib/evaluate.py
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  import pandas
  import warnings
  from typing import Union
  from ..log import get_module_logger
  from ..utils import get_date_range
  from ..utils.resam import Freq
  from ..strategy.base import BaseStrategy
  from ..backtest import get_exchange, position, backtest, executor
  from ..data import D
  from ..config import C
  from ..data.dataset.utils import get_level_index
label_desc: Use image node_id 2 for calling a global function with example usage: indicator_analysis(df, method) and returns: res