def to_records(self, index: bool=True, column_dtypes: Optional[Union[(str, Dtype, Dict[(Name, Union[(str, Dtype)])])]]=None, index_dtypes: Optional[Union[(str, Dtype, Dict[(Name, Union[(str, Dtype)])])]]=None) -> np.recarray:
    '\n        Convert DataFrame to a NumPy record array.\n\n        Index will be included as the first field of the record array if\n        requested.\n\n        .. note:: This method should only be used if the resulting NumPy ndarray is\n            expected to be small, as all the data is loaded into the driver\'s memory.\n\n        Parameters\n        ----------\n        index : bool, default True\n            Include index in resulting record array, stored in \'index\'\n            field or using the index label, if set.\n        column_dtypes : str, type, dict, default None\n            If a string or type, the data type to store all columns. If\n            a dictionary, a mapping of column names and indices (zero-indexed)\n            to specific data types.\n        index_dtypes : str, type, dict, default None\n            If a string or type, the data type to store all index levels. If\n            a dictionary, a mapping of index level names and indices\n            (zero-indexed) to specific data types.\n            This mapping is applied only if `index=True`.\n\n        Returns\n        -------\n        numpy.recarray\n            NumPy ndarray with the DataFrame labels as fields and each row\n            of the DataFrame as entries.\n\n        See Also\n        --------\n        DataFrame.from_records: Convert structured or record ndarray\n            to DataFrame.\n        numpy.recarray: An ndarray that allows field access using\n            attributes, analogous to typed columns in a\n            spreadsheet.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({\'A\': [1, 2], \'B\': [0.5, 0.75]},\n        ...                   index=[\'a\', \'b\'])\n        >>> df\n           A     B\n        a  1  0.50\n        b  2  0.75\n\n        >>> df.to_records() # doctest: +SKIP\n        rec.array([(\'a\', 1, 0.5 ), (\'b\', 2, 0.75)],\n                  dtype=[(\'index\', \'O\'), (\'A\', \'<i8\'), (\'B\', \'<f8\')])\n\n        The index can be excluded from the record array:\n\n        >>> df.to_records(index=False) # doctest: +SKIP\n        rec.array([(1, 0.5 ), (2, 0.75)],\n                  dtype=[(\'A\', \'<i8\'), (\'B\', \'<f8\')])\n\n        Specification of dtype for columns is new in pandas 0.24.0.\n        Data types can be specified for the columns:\n\n        >>> df.to_records(column_dtypes={"A": "int32"}) # doctest: +SKIP\n        rec.array([(\'a\', 1, 0.5 ), (\'b\', 2, 0.75)],\n                  dtype=[(\'index\', \'O\'), (\'A\', \'<i4\'), (\'B\', \'<f8\')])\n\n        Specification of dtype for index is new in pandas 0.24.0.\n        Data types can also be specified for the index:\n\n        >>> df.to_records(index_dtypes="<S2") # doctest: +SKIP\n        rec.array([(b\'a\', 1, 0.5 ), (b\'b\', 2, 0.75)],\n                  dtype=[(\'index\', \'S2\'), (\'A\', \'<i8\'), (\'B\', \'<f8\')])\n        '
    args = locals()
    psdf = self
    return validate_arguments_and_invoke_function(psdf._to_internal_pandas(), self.to_records, pd.DataFrame.to_records, args)
Convert DataFrame to a NumPy record array.

Index will be included as the first field of the record array if
requested.

.. note:: This method should only be used if the resulting NumPy ndarray is
    expected to be small, as all the data is loaded into the driver's memory.

Parameters
----------
index : bool, default True
    Include index in resulting record array, stored in 'index'
    field or using the index label, if set.
column_dtypes : str, type, dict, default None
    If a string or type, the data type to store all columns. If
    a dictionary, a mapping of column names and indices (zero-indexed)
    to specific data types.
index_dtypes : str, type, dict, default None
    If a string or type, the data type to store all index levels. If
    a dictionary, a mapping of index level names and indices
    (zero-indexed) to specific data types.
    This mapping is applied only if `index=True`.

Returns
-------
numpy.recarray
    NumPy ndarray with the DataFrame labels as fields and each row
    of the DataFrame as entries.

See Also
--------
DataFrame.from_records: Convert structured or record ndarray
    to DataFrame.
numpy.recarray: An ndarray that allows field access using
    attributes, analogous to typed columns in a
    spreadsheet.

Examples
--------
>>> df = ps.DataFrame({'A': [1, 2], 'B': [0.5, 0.75]},
...                   index=['a', 'b'])
>>> df
   A     B
a  1  0.50
b  2  0.75

>>> df.to_records() # doctest: +SKIP
rec.array([('a', 1, 0.5 ), ('b', 2, 0.75)],
          dtype=[('index', 'O'), ('A', '<i8'), ('B', '<f8')])

The index can be excluded from the record array:

>>> df.to_records(index=False) # doctest: +SKIP
rec.array([(1, 0.5 ), (2, 0.75)],
          dtype=[('A', '<i8'), ('B', '<f8')])

Specification of dtype for columns is new in pandas 0.24.0.
Data types can be specified for the columns:

>>> df.to_records(column_dtypes={"A": "int32"}) # doctest: +SKIP
rec.array([('a', 1, 0.5 ), ('b', 2, 0.75)],
          dtype=[('index', 'O'), ('A', '<i4'), ('B', '<f8')])

Specification of dtype for index is new in pandas 0.24.0.
Data types can also be specified for the index:

>>> df.to_records(index_dtypes="<S2") # doctest: +SKIP
rec.array([(b'a', 1, 0.5 ), (b'b', 2, 0.75)],
          dtype=[('index', 'S2'), ('A', '<i8'), ('B', '<f8')])
def to_records(self, index: bool=True, column_dtypes: Optional[Union[(str, Dtype, Dict[(Name, Union[(str, Dtype)])])]]=None, index_dtypes: Optional[Union[(str, Dtype, Dict[(Name, Union[(str, Dtype)])])]]=None) -> np.recarray:
    '\n        Convert DataFrame to a NumPy record array.\n\n        Index will be included as the first field of the record array if\n        requested.\n\n        .. note:: This method should only be used if the resulting NumPy ndarray is\n            expected to be small, as all the data is loaded into the driver\'s memory.\n\n        Parameters\n        ----------\n        index : bool, default True\n            Include index in resulting record array, stored in \'index\'\n            field or using the index label, if set.\n        column_dtypes : str, type, dict, default None\n            If a string or type, the data type to store all columns. If\n            a dictionary, a mapping of column names and indices (zero-indexed)\n            to specific data types.\n        index_dtypes : str, type, dict, default None\n            If a string or type, the data type to store all index levels. If\n            a dictionary, a mapping of index level names and indices\n            (zero-indexed) to specific data types.\n            This mapping is applied only if `index=True`.\n\n        Returns\n        -------\n        numpy.recarray\n            NumPy ndarray with the DataFrame labels as fields and each row\n            of the DataFrame as entries.\n\n        See Also\n        --------\n        DataFrame.from_records: Convert structured or record ndarray\n            to DataFrame.\n        numpy.recarray: An ndarray that allows field access using\n            attributes, analogous to typed columns in a\n            spreadsheet.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({\'A\': [1, 2], \'B\': [0.5, 0.75]},\n        ...                   index=[\'a\', \'b\'])\n        >>> df\n           A     B\n        a  1  0.50\n        b  2  0.75\n\n        >>> df.to_records() # doctest: +SKIP\n        rec.array([(\'a\', 1, 0.5 ), (\'b\', 2, 0.75)],\n                  dtype=[(\'index\', \'O\'), (\'A\', \'<i8\'), (\'B\', \'<f8\')])\n\n        The index can be excluded from the record array:\n\n        >>> df.to_records(index=False) # doctest: +SKIP\n        rec.array([(1, 0.5 ), (2, 0.75)],\n                  dtype=[(\'A\', \'<i8\'), (\'B\', \'<f8\')])\n\n        Specification of dtype for columns is new in pandas 0.24.0.\n        Data types can be specified for the columns:\n\n        >>> df.to_records(column_dtypes={"A": "int32"}) # doctest: +SKIP\n        rec.array([(\'a\', 1, 0.5 ), (\'b\', 2, 0.75)],\n                  dtype=[(\'index\', \'O\'), (\'A\', \'<i4\'), (\'B\', \'<f8\')])\n\n        Specification of dtype for index is new in pandas 0.24.0.\n        Data types can also be specified for the index:\n\n        >>> df.to_records(index_dtypes="<S2") # doctest: +SKIP\n        rec.array([(b\'a\', 1, 0.5 ), (b\'b\', 2, 0.75)],\n                  dtype=[(\'index\', \'S2\'), (\'A\', \'<i8\'), (\'B\', \'<f8\')])\n        '
    args = locals()
    psdf = self
    return validate_arguments_and_invoke_function(psdf._to_internal_pandas(), self.to_records, pd.DataFrame.to_records, args)