class_docstr: An Arrow Dataset from record batches in memory, or a Pandas DataFrame.
docstr: Create an ArrowDataset from a given Pandas DataFrame. Output types
  and shapes are inferred from the Arrow schema after DataFrame conversion.
  If preserve_index is True, the DataFrame index will be the last column.
  This method requires pyarrow to be installed.
  
  Args:
      df: a Pandas DataFrame
      columns: Optional column indices to use, if None all are used
      preserve_index: Flag to include the DataFrame index as the last column
      batch_size: Batch size of output tensors, setting a batch size here
                  will create batched tensors from Arrow memory and can be more
                  efficient than using tf.data.Dataset.batch().
                  NOTE: batch_size does not need to be set if batch_mode='auto'
      batch_mode: Mode of batching, supported strings:
                  "keep_remainder" (default, keeps partial batch data),
                  "drop_remainder" (discard partial batch data),
                  "auto" (size to number of records in Arrow record batch)
docstr_tok: ["Create","an","ArrowDataset","from","a","given","Pandas","DataFrame",".","Output","types","and","shapes","are","inferred","from","the","Arrow","schema","after","DataFrame","conversion",".","If","preserve_index","is","True",",","the","DataFrame","index","will","be","the","last","column",".","This","method","requires","pyarrow","to","be","installed",".","Args",":","df",":","a","Pandas","DataFrame","columns",":","Optional","column","indices","to","use",",","if","None","all","are","used","preserve_index",":","Flag","to","include","the","DataFrame","index","as","the","last","column","batch_size",":","Batch","size","of","output","tensors",",","setting","a","batch","size","here","will","create","batched","tensors","from","Arrow","memory","and","can","be","more","efficient","than","using","tf.data.Dataset.batch","(",")",".","NOTE",":","batch_size","does","not","need","to","be","set","if","batch_mode='auto'","batch_mode",":","Mode","of","batching",",","supported","strings",":","``","keep_remainder","''","(","default",",","keeps","partial","batch","data",")",",","``","drop_remainder","''","(","discard","partial","batch","data",")",",","``","auto","''","(","size","to","number","of","records","in","Arrow","record","batch",")"]
code: def from_pandas(
      cls,
      df,
      columns=None,
      preserve_index=True,
      batch_size=None,
      batch_mode="keep_remainder",
  ):
      """Create an ArrowDataset from a given Pandas DataFrame. Output types
      and shapes are inferred from the Arrow schema after DataFrame conversion.
      If preserve_index is True, the DataFrame index will be the last column.
      This method requires pyarrow to be installed.
  
      Args:
          df: a Pandas DataFrame
          columns: Optional column indices to use, if None all are used
          preserve_index: Flag to include the DataFrame index as the last column
          batch_size: Batch size of output tensors, setting a batch size here
                      will create batched tensors from Arrow memory and can be more
                      efficient than using tf.data.Dataset.batch().
                      NOTE: batch_size does not need to be set if batch_mode='auto'
          batch_mode: Mode of batching, supported strings:
                      "keep_remainder" (default, keeps partial batch data),
                      "drop_remainder" (discard partial batch data),
                      "auto" (size to number of records in Arrow record batch)
      """
      import pyarrow as pa  # pylint: disable=import-outside-toplevel
  
      if columns is not None:
          df = df.iloc[:, list(columns)]
      batch = pa.RecordBatch.from_pandas(
          df, preserve_index=preserve_index
      )
      columns = tuple(range(batch.num_columns))
      output_types, output_shapes = arrow_schema_to_tensor_types(
          batch.schema
      )
      return cls.from_record_batches(
          batch,
          output_types,
          output_shapes,
          columns=columns,
          batch_size=batch_size,
          batch_mode=batch_mode,
      )
  
imports: from functools import partial
  import io
  from itertools import chain
  import os
  import socket
  import threading
  import tempfile
  import tensorflow
  from tensorflow import dtypes
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.util import structure
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 3 for calling the ArrowDataset obj's underlying member method code with example usage: obj.from_pandas(cls, df, columns, preserve_index, batch_size, batch_mode) and returns: cls