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: Construct a new exchange object, potentially changing the parameters.
  ``nan_as_null`` is a keyword intended for the consumer to tell the
  producer to overwrite null values in the data with ``NaN``.
  It is intended for cases where the consumer does not support the bit
  mask or byte mask that is the producer's native representation.
  ``allow_copy`` is a keyword that defines whether or not the library is
  allowed to make a copy of the data. For example, copying data would be
  necessary if a library supports strided buffers, given that this
  protocol specifies contiguous buffers.
docstr_tok: ["Construct","a","new","exchange","object",",","potentially","changing","the","parameters",".","``","nan_as_null","``","is","a","keyword","intended","for","the","consumer","to","tell","the","producer","to","overwrite","null","values","in","the","data","with","``","NaN","``",".","It","is","intended","for","cases","where","the","consumer","does","not","support","the","bit","mask","or","byte","mask","that","is","the","producer","'s","native","representation",".","``","allow_copy","``","is","a","keyword","that","defines","whether","or","not","the","library","is","allowed","to","make","a","copy","of","the","data",".","For","example",",","copying","data","would","be","necessary","if","a","library","supports","strided","buffers",",","given","that","this","protocol","specifies","contiguous","buffers","."]
code: def __dataframe__(
      self, nan_as_null: bool = False, allow_copy: bool = True
  ) -> _PyArrowDataFrame:
      """
      Construct a new exchange object, potentially changing the parameters.
      ``nan_as_null`` is a keyword intended for the consumer to tell the
      producer to overwrite null values in the data with ``NaN``.
      It is intended for cases where the consumer does not support the bit
      mask or byte mask that is the producer's native representation.
      ``allow_copy`` is a keyword that defines whether or not the library is
      allowed to make a copy of the data. For example, copying data would be
      necessary if a library supports strided buffers, given that this
      protocol specifies contiguous buffers.
      """
      return _PyArrowDataFrame(self._df, nan_as_null, 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 2 for calling the _PyArrowDataFrame obj's underlying member method code with example usage: obj.__dataframe__(nan_as_null, allow_copy) and returns: _PyArrowDataFrame