class_docstr: Motivation:
      PortfolioMetrics is for supporting portfolio related metrics.
  
  Implementation:
  
      daily portfolio metrics of the account
      contain those followings: return, cost, turnover, account, cash, bench, value
      For each step(bar/day/minute), each column represents
      - return: the return of the portfolio generated by strategy **without transaction fee**.
      - cost: the transaction fee and slippage.
      - account: the total value of assets(cash and securities are both included) in user account based on the close price of each step.
      - cash: the amount of cash in user's account.
      - bench: the return of the benchmark
      - value: the total value of securities/stocks/instruments (cash is excluded).
  
      update report
class_docstr_tok: ["Motivation",":","PortfolioMetrics","is","for","supporting","portfolio","related","metrics",".","Implementation",":","daily","portfolio","metrics","of","the","account","contain","those","followings",":","return",",","cost",",","turnover",",","account",",","cash",",","bench",",","value","For","each","step","(","bar\/day\/minute",")",",","each","column","represents","-","return",":","the","return","of","the","portfolio","generated","by","strategy","*","*","without","transaction","fee","*","*",".","-","cost",":","the","transaction","fee","and","slippage",".","-","account",":","the","total","value","of","assets","(","cash","and","securities","are","both","included",")","in","user","account","based","on","the","close","price","of","each","step",".","-","cash",":","the","amount","of","cash","in","user","'s","account",".","-","bench",":","the","return","of","the","benchmark","-","value",":","the","total","value","of","securities\/stocks\/instruments","(","cash","is","excluded",")",".","update","report"]
docstr: load pm from a file
  should have format like
  columns = ['account', 'return', 'total_turnover', 'turnover', 'cost', 'total_cost', 'value', 'cash', 'bench']
      :param
          path: str/ pathlib.Path()
docstr_tok: ["load","pm","from","a","file","should","have","format","like","columns","=","[","'account","'",",","'return","'",",","'total_turnover","'",",","'turnover","'",",","'cost","'",",","'total_cost","'",",","'value","'",",","'cash","'",",","'bench","'","]",":","param","path",":","str\/","pathlib.Path","(",")"]
code: def load_portfolio_metrics(self, path: str) -> None:
      """load pm from a file
      should have format like
      columns = ['account', 'return', 'total_turnover', 'turnover', 'cost', 'total_cost', 'value', 'cash', 'bench']
          :param
              path: str/ pathlib.Path()
      """
      with pathlib.Path(path).open("rb") as f:
          r = pd.read_csv(f, index_col=0)
      r.index = pd.DatetimeIndex(r.index)
  
      index = r.index
      self.init_vars()
      for trade_start_time in index:
          self.update_portfolio_metrics_record(
              trade_start_time=trade_start_time,
              account_value=r.loc[trade_start_time]["account"],
              cash=r.loc[trade_start_time]["cash"],
              return_rate=r.loc[trade_start_time]["return"],
              total_turnover=r.loc[trade_start_time]["total_turnover"],
              turnover_rate=r.loc[trade_start_time]["turnover"],
              total_cost=r.loc[trade_start_time]["total_cost"],
              cost_rate=r.loc[trade_start_time]["cost"],
              stock_value=r.loc[trade_start_time]["value"],
              bench_value=r.loc[trade_start_time]["bench"],
          )
  
imports: from __future__ import annotations
  import pathlib
  from collections import OrderedDict
  from typing import Any, Dict, List, Optional, Text, Tuple, Type, Union, cast
  import numpy
  import pandas
  import qlib.utils.index_data
  from qlib.backtest.decision import BaseTradeDecision, Order, OrderDir
  from qlib.backtest.exchange import Exchange
  from ..tests.config import CSI300_BENCH
  from ..utils.resam import get_higher_eq_freq_feature, resam_ts_data
  from .high_performance_ds import BaseOrderIndicator, BaseSingleMetric, NumpyOrderIndicator
label_desc: Use image node_id 14 for calling the PortfolioMetrics obj's underlying member method code with example usage: obj.load_portfolio_metrics(path) without return types