class_docstr: A :class:`~perspective.View` object represents a specific transform
  (pivot, filter, sort, etc) configuration on an underlying
  :class:`~perspective.Table`.  :class:`~perspective.View` objects
  cannot be directly instantiated - they must be derived from an existing
  :class:`~perspective.Table` via the :func:`~perspective.Table.view()`
  method.
  
  :class:`~perspective.View` instances receive all updates from the
  :class:`~perspective.Table` from which they are derived, and can be
  serialized (via ``to_*`` methods) or trigger a callback when it is updated.
  :class:`~perspective.View` objects will remain in memory and actively
  process updates until :obj:`~perspective.View.delete()` method is called.
class_docstr_tok: ["A",":","class",":","`","~perspective.View","`","object","represents","a","specific","transform","(","pivot",",","filter",",","sort",",","etc",")","configuration","on","an","underlying",":","class",":","`","~perspective.Table","`",".",":","class",":","`","~perspective.View","`","objects","can","not","be","directly","instantiated","-","they","must","be","derived","from","an","existing",":","class",":","`","~perspective.Table","`","via","the",":","func",":","`","~perspective.Table.view","(",")","`","method",".",":","class",":","`","~perspective.View","`","instances","receive","all","updates","from","the",":","class",":","`","~perspective.Table","`","from","which","they","are","derived",",","and","can","be","serialized","(","via","``","to_","*","``","methods",")","or","trigger","a","callback","when","it","is","updated",".",":","class",":","`","~perspective.View","`","objects","will","remain","in","memory","and","actively","process","updates","until",":","obj",":","`","~perspective.View.delete","(",")","`","method","is","called","."]
docstr: Serialize the :class:`~perspective.View`'s dataset into a CSV string.
  
  Keyword Args:
      start_row (:obj:`int`): (Defaults to 0).
      end_row (:obj:`int`): (Defaults to
          :func:`perspective.View.num_rows()`).
      start_col (:obj:`int`): (Defaults to 0).
      end_col (:obj:`int`): (Defaults to
          :func:`perspective.View.num_columns()`).
      id (:obj:`bool`): Whether to return a logical row ID for each
          row (Defaults to ``False``).
      index (:obj:`bool`): Whether to return an implicit pkey for each
          row (Defaults to False).
      leaves_only (:obj:`bool`): Whether to return only the data at the
          end of the tree (Defaults to False).
      date_format (:obj:`str`): How ``datetime`` objects should be
          formatted in the CSV.
  
  Returns:
      :obj:`str`: A CSV-formatted string containing the serialized data.
docstr_tok: ["Serialize","the",":","class",":","`","~perspective.View","`","'s","dataset","into","a","CSV","string",".","Keyword","Args",":","start_row","(",":","obj",":","`","int","`",")",":","(","Defaults","to","0",")",".","end_row","(",":","obj",":","`","int","`",")",":","(","Defaults","to",":","func",":","`","perspective.View.num_rows","(",")","`",")",".","start_col","(",":","obj",":","`","int","`",")",":","(","Defaults","to","0",")",".","end_col","(",":","obj",":","`","int","`",")",":","(","Defaults","to",":","func",":","`","perspective.View.num_columns","(",")","`",")",".","id","(",":","obj",":","`","bool","`",")",":","Whether","to","return","a","logical","row","ID","for","each","row","(","Defaults","to","``","False","``",")",".","index","(",":","obj",":","`","bool","`",")",":","Whether","to","return","an","implicit","pkey","for","each","row","(","Defaults","to","False",")",".","leaves_only","(",":","obj",":","`","bool","`",")",":","Whether","to","return","only","the","data","at","the","end","of","the","tree","(","Defaults","to","False",")",".","date_format","(",":","obj",":","`","str","`",")",":","How","``","datetime","``","objects","should","be","formatted","in","the","CSV",".","Returns",":",":","obj",":","`","str","`",":","A","CSV-formatted","string","containing","the","serialized","data","."]
code: def to_csv(self, **kwargs):
      """Serialize the :class:`~perspective.View`'s dataset into a CSV string.
  
      Keyword Args:
          start_row (:obj:`int`): (Defaults to 0).
          end_row (:obj:`int`): (Defaults to
              :func:`perspective.View.num_rows()`).
          start_col (:obj:`int`): (Defaults to 0).
          end_col (:obj:`int`): (Defaults to
              :func:`perspective.View.num_columns()`).
          id (:obj:`bool`): Whether to return a logical row ID for each
              row (Defaults to ``False``).
          index (:obj:`bool`): Whether to return an implicit pkey for each
              row (Defaults to False).
          leaves_only (:obj:`bool`): Whether to return only the data at the
              end of the tree (Defaults to False).
          date_format (:obj:`str`): How ``datetime`` objects should be
              formatted in the CSV.
  
      Returns:
          :obj:`str`: A CSV-formatted string containing the serialized data.
      """
  
      options = _parse_format_options(self, kwargs)
      if self._is_unit_context:
          return to_csv_unit(
              self._view,
              options["start_row"],
              options["end_row"],
              options["start_col"],
              options["end_col"],
          )
      elif self._sides == 0:
          return to_csv_zero(
              self._view,
              options["start_row"],
              options["end_row"],
              options["start_col"],
              options["end_col"],
          )
      elif self._sides == 1:
          return to_csv_one(
              self._view,
              options["start_row"],
              options["end_row"],
              options["start_col"],
              options["end_col"],
          )
      else:
          return to_csv_two(
              self._view,
              options["start_row"],
              options["end_row"],
              options["start_col"],
              options["end_col"],
          )
  
imports: import pandas
  import json
  import datetime
  from functools import partial, wraps
  from random import random
  from .view_config import ViewConfig
  from ._data_formatter import to_format, _parse_format_options
  from ._constants import COLUMN_SEPARATOR_STRING
  from ._utils import _str_to_pythontype
  from ._callback_cache import _PerspectiveCallBackCache
  from ._date_validator import _PerspectiveDateValidator
  from .libpsppy import make_view_unit, make_view_zero, make_view_one, make_view_two, to_arrow_unit, to_arrow_zero, to_arrow_one, to_arrow_two, to_csv_unit, to_csv_zero, to_csv_one, to_csv_two, get_row_delta_unit, get_row_delta_zero, get_row_delta_one, get_row_delta_two, scalar_to_py
label_desc: Use image node_id 26 for calling the View obj's underlying member method code with example usage: obj.to_csv() and returns: to_csv_unit, to_csv_zero, to_csv_one, to_csv_two