class_docstr: A ledger to keep track of transactions that occur in the order
  management system.
docstr: Converts the ledger records into a data frame.
  
  Parameters
  ----------
  sort_by_order_seq : bool, default False
      If records should be sorted by each order path.
  
  Returns
  -------
  `pd.DataFrame`
      A data frame containing all the records in the ledger.
docstr_tok: ["Converts","the","ledger","records","into","a","data","frame",".","Parameters","--","--","--","--","--","sort_by_order_seq",":","bool",",","default","False","If","records","should","be","sorted","by","each","order","path",".","Returns","--","--","--","-","`","pd.DataFrame","`","A","data","frame","containing","all","the","records","in","the","ledger","."]
code: def as_frame(self, sort_by_order_seq: bool = False) -> "pd.DataFrame":
      """Converts the ledger records into a data frame.
  
      Parameters
      ----------
      sort_by_order_seq : bool, default False
          If records should be sorted by each order path.
  
      Returns
      -------
      `pd.DataFrame`
          A data frame containing all the records in the ledger.
      """
  
      if not sort_by_order_seq:
          return pd.DataFrame(self.transactions)
  
      df = pd.DataFrame(self.transactions)
      frames = []
      for poid in df.poid.unique():
          frames += [df.loc[df.poid == poid, :]]
  
      return pd.concat(frames, ignore_index=True, axis=0)
  
imports: from typing import List
  from collections import namedtuple
  import pandas
label_desc: Use image node_id 3 for calling the Ledger obj's underlying member method code with example usage: obj.as_frame(sort_by_order_seq) and returns: pd, pd