parameters: (self, dtype, copy=False, errors="raise", **kwargs)
return_statement: return result
docstring: Cast the DataFrame to the given dtype
  
          Parameters
          ----------
  
          dtype : data type, or dict of column name -> data type
              Use a numpy.dtype or Python type to cast entire DataFrame object to
              the same type. Alternatively, use ``{col: dtype, ...}``, where col
              is a column label and dtype is a numpy.dtype or Python type
              to cast one or more of the DataFrame's columns to
              column-specific types.
          copy : bool, default False
              Return a deep-copy when ``copy=True``. Note by default
              ``copy=False`` setting is used and hence changes to
              values then may propagate to other cudf objects.
          errors : {'raise', 'ignore', 'warn'}, default 'raise'
              Control raising of exceptions on invalid data for provided dtype.
  
              -   ``raise`` : allow exceptions to be raised
              -   ``ignore`` : suppress exceptions. On error return original
                  object.
              -   ``warn`` : prints last exceptions as warnings and
                  return original object.
          **kwargs : extra arguments to pass on to the constructor
  
          Returns
          -------
          casted : DataFrame
  
          Examples
          --------
          >>> import cudf
          >>> df = cudf.DataFrame({'a': [10, 20, 30], 'b': [1, 2, 3]})
          >>> df
              a  b
          0  10  1
          1  20  2
          2  30  3
          >>> df.dtypes
          a    int64
          b    int64
          dtype: object
  
          Cast all columns to `int32`:
  
          >>> df.astype('int32').dtypes
          a    int32
          b    int32
          dtype: object
  
          Cast `a` to `float32` using a dictionary:
  
          >>> df.astype({'a': 'float32'}).dtypes
          a    float32
          b      int64
          dtype: object
          >>> df.astype({'a': 'float32'})
                a  b
          0  10.0  1
          1  20.0  2
          2  30.0  3
docstring_summary: Cast the DataFrame to the given dtype
docstring_tokens: Cast the DataFrame to the given dtype
function: def astype(self, dtype, copy=False, errors="raise", **kwargs):
          """
          Cast the DataFrame to the given dtype
  
          Parameters
          ----------
  
          dtype : data type, or dict of column name -> data type
              Use a numpy.dtype or Python type to cast entire DataFrame object to
              the same type. Alternatively, use ``{col: dtype, ...}``, where col
              is a column label and dtype is a numpy.dtype or Python type
              to cast one or more of the DataFrame's columns to
              column-specific types.
          copy : bool, default False
              Return a deep-copy when ``copy=True``. Note by default
              ``copy=False`` setting is used and hence changes to
              values then may propagate to other cudf objects.
          errors : {'raise', 'ignore', 'warn'}, default 'raise'
              Control raising of exceptions on invalid data for provided dtype.
  
              -   ``raise`` : allow exceptions to be raised
              -   ``ignore`` : suppress exceptions. On error return original
                  object.
              -   ``warn`` : prints last exceptions as warnings and
                  return original object.
          **kwargs : extra arguments to pass on to the constructor
  
          Returns
          -------
          casted : DataFrame
  
          Examples
          --------
          >>> import cudf
          >>> df = cudf.DataFrame({'a': [10, 20, 30], 'b': [1, 2, 3]})
          >>> df
              a  b
          0  10  1
          1  20  2
          2  30  3
          >>> df.dtypes
          a    int64
          b    int64
          dtype: object
  
          Cast all columns to `int32`:
  
          >>> df.astype('int32').dtypes
          a    int32
          b    int32
          dtype: object
  
          Cast `a` to `float32` using a dictionary:
  
          >>> df.astype({'a': 'float32'}).dtypes
          a    float32
          b      int64
          dtype: object
          >>> df.astype({'a': 'float32'})
                a  b
          0  10.0  1
          1  20.0  2
          2  30.0  3
          """
          result = DataFrame(index=self.index)
  
          if is_dict_like(dtype):
              current_cols = self._data.names
              if len(set(dtype.keys()) - set(current_cols)) > 0:
                  raise KeyError(
                      "Only a column name can be used for the "
                      "key in a dtype mappings argument."
                  )
              for col_name in current_cols:
                  if col_name in dtype:
                      result._data[col_name] = self._data[col_name].astype(
                          dtype=dtype[col_name],
                          errors=errors,
                          copy=copy,
                          **kwargs,
                      )
                  else:
                      result._data[col_name] = (
                          self._data[col_name].copy(deep=True)
                          if copy
                          else self._data[col_name]
                      )
          else:
              for col in self._data:
                  result._data[col] = self._data[col].astype(
                      dtype=dtype, **kwargs
                  )
  
          return result
function_tokens: def astype ( self , dtype , copy = False , errors = "raise" , * * kwargs ) : result = DataFrame ( index = self . index ) if is_dict_like ( dtype ) : current_cols = self . _data . names if len ( set ( dtype . keys ( ) ) - set ( current_cols ) ) > 0 : raise KeyError ( "Only a column name can be used for the " "key in a dtype mappings argument." ) for col_name in current_cols : if col_name in dtype : result . _data [ col_name ] = self . _data [ col_name ] . astype ( dtype = dtype [ col_name ] , errors = errors , copy = copy , * * kwargs , ) else : result . _data [ col_name ] = ( self . _data [ col_name ] . copy ( deep = True ) if copy else self . _data [ col_name ] ) else : for col in self . _data : result . _data [ col ] = self . _data [ col ] . astype ( dtype = dtype , * * kwargs ) return result