def select_dtypes(self, include: Optional[Union[(str, List[str])]]=None, exclude: Optional[Union[(str, List[str])]]=None) -> 'DataFrame':
    "\n        Return a subset of the DataFrame's columns based on the column dtypes.\n\n        Parameters\n        ----------\n        include, exclude : scalar or list-like\n            A selection of dtypes or strings to be included/excluded. At least\n            one of these parameters must be supplied. It also takes Spark SQL\n            DDL type strings, for instance, 'string' and 'date'.\n\n        Returns\n        -------\n        DataFrame\n            The subset of the frame including the dtypes in ``include`` and\n            excluding the dtypes in ``exclude``.\n\n        Raises\n        ------\n        ValueError\n            * If both of ``include`` and ``exclude`` are empty\n\n                >>> df = ps.DataFrame({'a': [1, 2] * 3,\n                ...                    'b': [True, False] * 3,\n                ...                    'c': [1.0, 2.0] * 3})\n                >>> df.select_dtypes()\n                Traceback (most recent call last):\n                ...\n                ValueError: at least one of include or exclude must be nonempty\n\n            * If ``include`` and ``exclude`` have overlapping elements\n\n                >>> df = ps.DataFrame({'a': [1, 2] * 3,\n                ...                    'b': [True, False] * 3,\n                ...                    'c': [1.0, 2.0] * 3})\n                >>> df.select_dtypes(include='a', exclude='a')\n                Traceback (most recent call last):\n                ...\n                ValueError: include and exclude overlap on {'a'}\n\n        Notes\n        -----\n        * To select datetimes, use ``np.datetime64``, ``'datetime'`` or\n          ``'datetime64'``\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'a': [1, 2] * 3,\n        ...                    'b': [True, False] * 3,\n        ...                    'c': [1.0, 2.0] * 3,\n        ...                    'd': ['a', 'b'] * 3}, columns=['a', 'b', 'c', 'd'])\n        >>> df\n           a      b    c  d\n        0  1   True  1.0  a\n        1  2  False  2.0  b\n        2  1   True  1.0  a\n        3  2  False  2.0  b\n        4  1   True  1.0  a\n        5  2  False  2.0  b\n\n        >>> df.select_dtypes(include='bool')\n               b\n        0   True\n        1  False\n        2   True\n        3  False\n        4   True\n        5  False\n\n        >>> df.select_dtypes(include=['float64'], exclude=['int'])\n             c\n        0  1.0\n        1  2.0\n        2  1.0\n        3  2.0\n        4  1.0\n        5  2.0\n\n        >>> df.select_dtypes(exclude=['int'])\n               b    c  d\n        0   True  1.0  a\n        1  False  2.0  b\n        2   True  1.0  a\n        3  False  2.0  b\n        4   True  1.0  a\n        5  False  2.0  b\n\n        Spark SQL DDL type strings can be used as well.\n\n        >>> df.select_dtypes(exclude=['string'])\n           a      b    c\n        0  1   True  1.0\n        1  2  False  2.0\n        2  1   True  1.0\n        3  2  False  2.0\n        4  1   True  1.0\n        5  2  False  2.0\n        "
    from pyspark.sql.types import _parse_datatype_string
    include_list: List[str]
    if (not is_list_like(include)):
        include_list = ([cast(str, include)] if (include is not None) else [])
    else:
        include_list = list(include)
    exclude_list: List[str]
    if (not is_list_like(exclude)):
        exclude_list = ([cast(str, exclude)] if (exclude is not None) else [])
    else:
        exclude_list = list(exclude)
    if (not any((include_list, exclude_list))):
        raise ValueError('at least one of include or exclude must be nonempty')
    if set(include_list).intersection(set(exclude_list)):
        raise ValueError('include and exclude overlap on {inc_ex}'.format(inc_ex=set(include_list).intersection(set(exclude_list))))
    include_spark_type = []
    for inc in include_list:
        try:
            include_spark_type.append(_parse_datatype_string(inc))
        except BaseException:
            pass
    exclude_spark_type = []
    for exc in exclude_list:
        try:
            exclude_spark_type.append(_parse_datatype_string(exc))
        except BaseException:
            pass
    include_numpy_type = []
    for inc in include_list:
        try:
            include_numpy_type.append(infer_dtype_from_object(inc))
        except BaseException:
            pass
    exclude_numpy_type = []
    for exc in exclude_list:
        try:
            exclude_numpy_type.append(infer_dtype_from_object(exc))
        except BaseException:
            pass
    column_labels = []
    for label in self._internal.column_labels:
        if (len(include_list) > 0):
            should_include = ((infer_dtype_from_object(self._psser_for(label).dtype.name) in include_numpy_type) or (self._internal.spark_type_for(label) in include_spark_type))
        else:
            should_include = (not ((infer_dtype_from_object(self._psser_for(label).dtype.name) in exclude_numpy_type) or (self._internal.spark_type_for(label) in exclude_spark_type)))
        if should_include:
            column_labels.append(label)
    return DataFrame(self._internal.with_new_columns([self._psser_for(label) for label in column_labels]))
Return a subset of the DataFrame's columns based on the column dtypes.

Parameters
----------
include, exclude : scalar or list-like
    A selection of dtypes or strings to be included/excluded. At least
    one of these parameters must be supplied. It also takes Spark SQL
    DDL type strings, for instance, 'string' and 'date'.

Returns
-------
DataFrame
    The subset of the frame including the dtypes in ``include`` and
    excluding the dtypes in ``exclude``.

Raises
------
ValueError
    * If both of ``include`` and ``exclude`` are empty

        >>> df = ps.DataFrame({'a': [1, 2] * 3,
        ...                    'b': [True, False] * 3,
        ...                    'c': [1.0, 2.0] * 3})
        >>> df.select_dtypes()
        Traceback (most recent call last):
        ...
        ValueError: at least one of include or exclude must be nonempty

    * If ``include`` and ``exclude`` have overlapping elements

        >>> df = ps.DataFrame({'a': [1, 2] * 3,
        ...                    'b': [True, False] * 3,
        ...                    'c': [1.0, 2.0] * 3})
        >>> df.select_dtypes(include='a', exclude='a')
        Traceback (most recent call last):
        ...
        ValueError: include and exclude overlap on {'a'}

Notes
-----
* To select datetimes, use ``np.datetime64``, ``'datetime'`` or
  ``'datetime64'``

Examples
--------
>>> df = ps.DataFrame({'a': [1, 2] * 3,
...                    'b': [True, False] * 3,
...                    'c': [1.0, 2.0] * 3,
...                    'd': ['a', 'b'] * 3}, columns=['a', 'b', 'c', 'd'])
>>> df
   a      b    c  d
0  1   True  1.0  a
1  2  False  2.0  b
2  1   True  1.0  a
3  2  False  2.0  b
4  1   True  1.0  a
5  2  False  2.0  b

>>> df.select_dtypes(include='bool')
       b
0   True
1  False
2   True
3  False
4   True
5  False

>>> df.select_dtypes(include=['float64'], exclude=['int'])
     c
0  1.0
1  2.0
2  1.0
3  2.0
4  1.0
5  2.0

>>> df.select_dtypes(exclude=['int'])
       b    c  d
0   True  1.0  a
1  False  2.0  b
2   True  1.0  a
3  False  2.0  b
4   True  1.0  a
5  False  2.0  b

Spark SQL DDL type strings can be used as well.

>>> df.select_dtypes(exclude=['string'])
   a      b    c
0  1   True  1.0
1  2  False  2.0
2  1   True  1.0
3  2  False  2.0
4  1   True  1.0
5  2  False  2.0
def select_dtypes(self, include: Optional[Union[(str, List[str])]]=None, exclude: Optional[Union[(str, List[str])]]=None) -> 'DataFrame':
    "\n        Return a subset of the DataFrame's columns based on the column dtypes.\n\n        Parameters\n        ----------\n        include, exclude : scalar or list-like\n            A selection of dtypes or strings to be included/excluded. At least\n            one of these parameters must be supplied. It also takes Spark SQL\n            DDL type strings, for instance, 'string' and 'date'.\n\n        Returns\n        -------\n        DataFrame\n            The subset of the frame including the dtypes in ``include`` and\n            excluding the dtypes in ``exclude``.\n\n        Raises\n        ------\n        ValueError\n            * If both of ``include`` and ``exclude`` are empty\n\n                >>> df = ps.DataFrame({'a': [1, 2] * 3,\n                ...                    'b': [True, False] * 3,\n                ...                    'c': [1.0, 2.0] * 3})\n                >>> df.select_dtypes()\n                Traceback (most recent call last):\n                ...\n                ValueError: at least one of include or exclude must be nonempty\n\n            * If ``include`` and ``exclude`` have overlapping elements\n\n                >>> df = ps.DataFrame({'a': [1, 2] * 3,\n                ...                    'b': [True, False] * 3,\n                ...                    'c': [1.0, 2.0] * 3})\n                >>> df.select_dtypes(include='a', exclude='a')\n                Traceback (most recent call last):\n                ...\n                ValueError: include and exclude overlap on {'a'}\n\n        Notes\n        -----\n        * To select datetimes, use ``np.datetime64``, ``'datetime'`` or\n          ``'datetime64'``\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'a': [1, 2] * 3,\n        ...                    'b': [True, False] * 3,\n        ...                    'c': [1.0, 2.0] * 3,\n        ...                    'd': ['a', 'b'] * 3}, columns=['a', 'b', 'c', 'd'])\n        >>> df\n           a      b    c  d\n        0  1   True  1.0  a\n        1  2  False  2.0  b\n        2  1   True  1.0  a\n        3  2  False  2.0  b\n        4  1   True  1.0  a\n        5  2  False  2.0  b\n\n        >>> df.select_dtypes(include='bool')\n               b\n        0   True\n        1  False\n        2   True\n        3  False\n        4   True\n        5  False\n\n        >>> df.select_dtypes(include=['float64'], exclude=['int'])\n             c\n        0  1.0\n        1  2.0\n        2  1.0\n        3  2.0\n        4  1.0\n        5  2.0\n\n        >>> df.select_dtypes(exclude=['int'])\n               b    c  d\n        0   True  1.0  a\n        1  False  2.0  b\n        2   True  1.0  a\n        3  False  2.0  b\n        4   True  1.0  a\n        5  False  2.0  b\n\n        Spark SQL DDL type strings can be used as well.\n\n        >>> df.select_dtypes(exclude=['string'])\n           a      b    c\n        0  1   True  1.0\n        1  2  False  2.0\n        2  1   True  1.0\n        3  2  False  2.0\n        4  1   True  1.0\n        5  2  False  2.0\n        "
    from pyspark.sql.types import _parse_datatype_string
    include_list: List[str]
    if (not is_list_like(include)):
        include_list = ([cast(str, include)] if (include is not None) else [])
    else:
        include_list = list(include)
    exclude_list: List[str]
    if (not is_list_like(exclude)):
        exclude_list = ([cast(str, exclude)] if (exclude is not None) else [])
    else:
        exclude_list = list(exclude)
    if (not any((include_list, exclude_list))):
        raise ValueError('at least one of include or exclude must be nonempty')
    if set(include_list).intersection(set(exclude_list)):
        raise ValueError('include and exclude overlap on {inc_ex}'.format(inc_ex=set(include_list).intersection(set(exclude_list))))
    include_spark_type = []
    for inc in include_list:
        try:
            include_spark_type.append(_parse_datatype_string(inc))
        except BaseException:
            pass
    exclude_spark_type = []
    for exc in exclude_list:
        try:
            exclude_spark_type.append(_parse_datatype_string(exc))
        except BaseException:
            pass
    include_numpy_type = []
    for inc in include_list:
        try:
            include_numpy_type.append(infer_dtype_from_object(inc))
        except BaseException:
            pass
    exclude_numpy_type = []
    for exc in exclude_list:
        try:
            exclude_numpy_type.append(infer_dtype_from_object(exc))
        except BaseException:
            pass
    column_labels = []
    for label in self._internal.column_labels:
        if (len(include_list) > 0):
            should_include = ((infer_dtype_from_object(self._psser_for(label).dtype.name) in include_numpy_type) or (self._internal.spark_type_for(label) in include_spark_type))
        else:
            should_include = (not ((infer_dtype_from_object(self._psser_for(label).dtype.name) in exclude_numpy_type) or (self._internal.spark_type_for(label) in exclude_spark_type)))
        if should_include:
            column_labels.append(label)
    return DataFrame(self._internal.with_new_columns([self._psser_for(label) for label in column_labels]))