code: def datatable_to_dataframe(
      table, split_texts_in_lines=False, **kwargs
  ):
      """
      Create a pandas dataframe using datatable <table> and joining all texts in the individual cells.
      """
      import pandas as pd
  
      n_rows = len(table)
      if n_rows == 0:
          raise ValueError("data table must contain rows")
  
      n_cols = len(table[0])
      if n_cols == 0:
          raise ValueError("data table must contain columns")
  
      col_series = OrderedDict()
      zfill_n = len(str(n_cols + 1))
      for i in range(n_cols):
          col_data = []
          for j in range(n_rows):
              if split_texts_in_lines:
                  cell_str = create_text_from_lines(
                      put_texts_in_lines(table[j][i]), **kwargs
                  )
              else:
                  cell_str = join_texts(table[j][i], **kwargs)
  
              col_data.append(cell_str)
  
          ser = pd.Series(col_data)
          ser.name = "col" + str(i + 1).zfill(zfill_n)
          col_series[ser.name] = ser
  
      return pd.DataFrame(col_series)
  
imports: from collections import defaultdict, OrderedDict
  from pdftabextract.geom import pt, rect, rect_from_text, rectintersect, rectcenter_dist
  from pdftabextract.textboxes import join_texts, create_text_from_lines, put_texts_in_lines
label_desc: Use image node_id 3 for calling a global function with example usage: datatable_to_dataframe(table, split_texts_in_lines) and returns: pd