class_docstr: A data frame class, with only the methods required by the interchange
  protocol defined.
  
  A "data frame" represents an ordered collection of named columns.
  A column's "name" must be a unique string.
  Columns may be accessed by name or by position.
  
  This could be a public data frame class, or an object with the methods and
  attributes defined on this DataFrame class could be returned from the
  ``__dataframe__`` method of a public data frame class in a library adhering
  to the dataframe interchange protocol specification.
class_docstr_tok: ["A","data","frame","class",",","with","only","the","methods","required","by","the","interchange","protocol","defined",".","A","``","data","frame","''","represents","an","ordered","collection","of","named","columns",".","A","column","'s","``","name","''","must","be","a","unique","string",".","Columns","may","be","accessed","by","name","or","by","position",".","This","could","be","a","public","data","frame","class",",","or","an","object","with","the","methods","and","attributes","defined","on","this","DataFrame","class","could","be","returned","from","the","``","__dataframe__","``","method","of","a","public","data","frame","class","in","a","library","adhering","to","the","dataframe","interchange","protocol","specification","."]
docstr: Constructor - an instance of this (private) class is returned from
  `pa.Table.__dataframe__` or `pa.RecordBatch.__dataframe__`.
docstr_tok: ["Constructor","-","an","instance","of","this","(","private",")","class","is","returned","from","`","pa.Table.__dataframe__","`","or","`","pa.RecordBatch.__dataframe__","`","."]
code: def __init__(
      self,
      df: pa.Table | pa.RecordBatch,
      nan_as_null: bool = False,
      allow_copy: bool = True,
  ) -> None:
      """
      Constructor - an instance of this (private) class is returned from
      `pa.Table.__dataframe__` or `pa.RecordBatch.__dataframe__`.
      """
      self._df = df
      # ``nan_as_null`` is a keyword intended for the consumer to tell the
      # producer to overwrite null values in the data with ``NaN`` (or
      # ``NaT``).
      if nan_as_null is True:
          raise RuntimeError(
              "nan_as_null=True currently has no effect, "
              "use the default nan_as_null=False"
          )
      self._nan_as_null = nan_as_null
      self._allow_copy = allow_copy
  
file_path: arrow/python/pyarrow/interchange/dataframe.py
imports: from __future__ import annotations
  from typing import Any, Iterable, Optional, Sequence
  import pyarrow
  from pyarrow.interchange.column import _PyArrowColumn
label_desc: Use image node_id 1 to create a new _PyArrowDataFrame object  with example: obj = _PyArrowDataFrame(df, nan_as_null, allow_copy)