def duplicated(self, subset: Optional[Union[(Name, List[Name])]]=None, keep: Union[(bool, str)]='first') -> 'Series':
    "\n        Return boolean Series denoting duplicate rows, optionally only considering certain columns.\n\n        Parameters\n        ----------\n        subset : column label or sequence of labels, optional\n            Only consider certain columns for identifying duplicates,\n            by default use all of the columns\n        keep : {'first', 'last', False}, default 'first'\n           - ``first`` : Mark duplicates as ``True`` except for the first occurrence.\n           - ``last`` : Mark duplicates as ``True`` except for the last occurrence.\n           - False : Mark all duplicates as ``True``.\n\n        Returns\n        -------\n        duplicated : Series\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'a': [1, 1, 1, 3], 'b': [1, 1, 1, 4], 'c': [1, 1, 1, 5]},\n        ...                   columns = ['a', 'b', 'c'])\n        >>> df\n           a  b  c\n        0  1  1  1\n        1  1  1  1\n        2  1  1  1\n        3  3  4  5\n\n        >>> df.duplicated().sort_index()\n        0    False\n        1     True\n        2     True\n        3    False\n        dtype: bool\n\n        Mark duplicates as ``True`` except for the last occurrence.\n\n        >>> df.duplicated(keep='last').sort_index()\n        0     True\n        1     True\n        2    False\n        3    False\n        dtype: bool\n\n        Mark all duplicates as ``True``.\n\n        >>> df.duplicated(keep=False).sort_index()\n        0     True\n        1     True\n        2     True\n        3    False\n        dtype: bool\n        "
    from pyspark.pandas.series import first_series
    (sdf, column) = self._mark_duplicates(subset, keep)
    sdf = sdf.select((self._internal.index_spark_columns + [scol_for(sdf, column).alias(SPARK_DEFAULT_SERIES_NAME)]))
    return first_series(DataFrame(InternalFrame(spark_frame=sdf, index_spark_columns=[scol_for(sdf, col) for col in self._internal.index_spark_column_names], index_names=self._internal.index_names, index_fields=self._internal.index_fields, column_labels=[None], data_spark_columns=[scol_for(sdf, SPARK_DEFAULT_SERIES_NAME)])))
Return boolean Series denoting duplicate rows, optionally only considering certain columns.

Parameters
----------
subset : column label or sequence of labels, optional
    Only consider certain columns for identifying duplicates,
    by default use all of the columns
keep : {'first', 'last', False}, default 'first'
   - ``first`` : Mark duplicates as ``True`` except for the first occurrence.
   - ``last`` : Mark duplicates as ``True`` except for the last occurrence.
   - False : Mark all duplicates as ``True``.

Returns
-------
duplicated : Series

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

>>> df.duplicated().sort_index()
0    False
1     True
2     True
3    False
dtype: bool

Mark duplicates as ``True`` except for the last occurrence.

>>> df.duplicated(keep='last').sort_index()
0     True
1     True
2    False
3    False
dtype: bool

Mark all duplicates as ``True``.

>>> df.duplicated(keep=False).sort_index()
0     True
1     True
2     True
3    False
dtype: bool
def duplicated(self, subset: Optional[Union[(Name, List[Name])]]=None, keep: Union[(bool, str)]='first') -> 'Series':
    "\n        Return boolean Series denoting duplicate rows, optionally only considering certain columns.\n\n        Parameters\n        ----------\n        subset : column label or sequence of labels, optional\n            Only consider certain columns for identifying duplicates,\n            by default use all of the columns\n        keep : {'first', 'last', False}, default 'first'\n           - ``first`` : Mark duplicates as ``True`` except for the first occurrence.\n           - ``last`` : Mark duplicates as ``True`` except for the last occurrence.\n           - False : Mark all duplicates as ``True``.\n\n        Returns\n        -------\n        duplicated : Series\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'a': [1, 1, 1, 3], 'b': [1, 1, 1, 4], 'c': [1, 1, 1, 5]},\n        ...                   columns = ['a', 'b', 'c'])\n        >>> df\n           a  b  c\n        0  1  1  1\n        1  1  1  1\n        2  1  1  1\n        3  3  4  5\n\n        >>> df.duplicated().sort_index()\n        0    False\n        1     True\n        2     True\n        3    False\n        dtype: bool\n\n        Mark duplicates as ``True`` except for the last occurrence.\n\n        >>> df.duplicated(keep='last').sort_index()\n        0     True\n        1     True\n        2    False\n        3    False\n        dtype: bool\n\n        Mark all duplicates as ``True``.\n\n        >>> df.duplicated(keep=False).sort_index()\n        0     True\n        1     True\n        2     True\n        3    False\n        dtype: bool\n        "
    from pyspark.pandas.series import first_series
    (sdf, column) = self._mark_duplicates(subset, keep)
    sdf = sdf.select((self._internal.index_spark_columns + [scol_for(sdf, column).alias(SPARK_DEFAULT_SERIES_NAME)]))
    return first_series(DataFrame(InternalFrame(spark_frame=sdf, index_spark_columns=[scol_for(sdf, col) for col in self._internal.index_spark_column_names], index_names=self._internal.index_names, index_fields=self._internal.index_fields, column_labels=[None], data_spark_columns=[scol_for(sdf, SPARK_DEFAULT_SERIES_NAME)])))