code: def QA_data_calc_marketvalue(data, xdxr):
      '使用数据库数据计算复权'
      mv = xdxr.query('category!=6').loc[:,
                                         ['shares_after',
                                          'liquidity_after']].dropna()
      res = pd.concat([data, mv], axis=1)
  
      res = res.assign(
          shares=res.shares_after.fillna(method='ffill'),
          lshares=res.liquidity_after.fillna(method='ffill')
      )
      return res.assign(mv=res.close*res.shares*10000, liquidity_mv=res.close*res.lshares*10000).drop(['shares_after', 'liquidity_after'], axis=1)\
              .loc[(slice(data.index.remove_unused_levels().levels[0][0],data.index.remove_unused_levels().levels[0][-1]),slice(None)),:f QA_data_calc_marketvalue(data, xdxr):
      '使用数据库数据计算复权'
      mv = xdxr.query('category!=6').loc[:,
                                         ['shares_after',
                                          'liquidity_after']].dropna()
      res = pd.concat([data, mv], axis=1)
  
      res = res.assign(
          shares=res.shares_after.fillna(method='ffill'),
          lshares=res.liquidity_after.fillna(method='ffill')
      )
      return res.assign(mv=res.close*res.shares*10000, liquidity_mv=res.close*res.lshares*10000).drop(['shares_after', 'liquidity_after'], axis=1)\
              .loc[(slice(data.index.remove_unused_levels().levels[0][0],data.index.remove_unused_levels().levels[0][-1]),slice(None)),:]
docs: 使用数据库数据计算复权