def nunique(self, axis: Axis=0, dropna: bool=True, approx: bool=False, rsd: float=0.05) -> 'Series':
    "\n        Return number of unique elements in the object.\n\n        Excludes NA values by default.\n\n        Parameters\n        ----------\n        axis : int, default 0 or 'index'\n            Can only be set to 0 at the moment.\n        dropna : bool, default True\n            Don’t include NaN in the count.\n        approx: bool, default False\n            If False, will use the exact algorithm and return the exact number of unique.\n            If True, it uses the HyperLogLog approximate algorithm, which is significantly faster\n            for large amount of data.\n            Note: This parameter is specific to pandas-on-Spark and is not found in pandas.\n        rsd: float, default 0.05\n            Maximum estimation error allowed in the HyperLogLog algorithm.\n            Note: Just like ``approx`` this parameter is specific to pandas-on-Spark.\n\n        Returns\n        -------\n        The number of unique values per column as a pandas-on-Spark Series.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'A': [1, 2, 3], 'B': [np.nan, 3, np.nan]})\n        >>> df.nunique()\n        A    3\n        B    1\n        dtype: int64\n\n        >>> df.nunique(dropna=False)\n        A    3\n        B    2\n        dtype: int64\n\n        On big data, we recommend using the approximate algorithm to speed up this function.\n        The result will be very close to the exact unique count.\n\n        >>> df.nunique(approx=True)\n        A    3\n        B    1\n        dtype: int64\n        "
    from pyspark.pandas.series import first_series
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('axis should be either 0 or "index" currently.')
    sdf = self._internal.spark_frame.select(([SF.lit(None).cast(StringType()).alias(SPARK_DEFAULT_INDEX_NAME)] + [self._psser_for(label)._nunique(dropna, approx, rsd) for label in self._internal.column_labels]))
    with ps.option_context('compute.max_rows', 1):
        internal = self._internal.copy(spark_frame=sdf, index_spark_columns=[scol_for(sdf, SPARK_DEFAULT_INDEX_NAME)], index_names=[None], index_fields=[None], data_spark_columns=[scol_for(sdf, col) for col in self._internal.data_spark_column_names], data_fields=None)
        return first_series(DataFrame(internal).transpose())
Return number of unique elements in the object.

Excludes NA values by default.

Parameters
----------
axis : int, default 0 or 'index'
    Can only be set to 0 at the moment.
dropna : bool, default True
    Don’t include NaN in the count.
approx: bool, default False
    If False, will use the exact algorithm and return the exact number of unique.
    If True, it uses the HyperLogLog approximate algorithm, which is significantly faster
    for large amount of data.
    Note: This parameter is specific to pandas-on-Spark and is not found in pandas.
rsd: float, default 0.05
    Maximum estimation error allowed in the HyperLogLog algorithm.
    Note: Just like ``approx`` this parameter is specific to pandas-on-Spark.

Returns
-------
The number of unique values per column as a pandas-on-Spark Series.

Examples
--------
>>> df = ps.DataFrame({'A': [1, 2, 3], 'B': [np.nan, 3, np.nan]})
>>> df.nunique()
A    3
B    1
dtype: int64

>>> df.nunique(dropna=False)
A    3
B    2
dtype: int64

On big data, we recommend using the approximate algorithm to speed up this function.
The result will be very close to the exact unique count.

>>> df.nunique(approx=True)
A    3
B    1
dtype: int64
def nunique(self, axis: Axis=0, dropna: bool=True, approx: bool=False, rsd: float=0.05) -> 'Series':
    "\n        Return number of unique elements in the object.\n\n        Excludes NA values by default.\n\n        Parameters\n        ----------\n        axis : int, default 0 or 'index'\n            Can only be set to 0 at the moment.\n        dropna : bool, default True\n            Don’t include NaN in the count.\n        approx: bool, default False\n            If False, will use the exact algorithm and return the exact number of unique.\n            If True, it uses the HyperLogLog approximate algorithm, which is significantly faster\n            for large amount of data.\n            Note: This parameter is specific to pandas-on-Spark and is not found in pandas.\n        rsd: float, default 0.05\n            Maximum estimation error allowed in the HyperLogLog algorithm.\n            Note: Just like ``approx`` this parameter is specific to pandas-on-Spark.\n\n        Returns\n        -------\n        The number of unique values per column as a pandas-on-Spark Series.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'A': [1, 2, 3], 'B': [np.nan, 3, np.nan]})\n        >>> df.nunique()\n        A    3\n        B    1\n        dtype: int64\n\n        >>> df.nunique(dropna=False)\n        A    3\n        B    2\n        dtype: int64\n\n        On big data, we recommend using the approximate algorithm to speed up this function.\n        The result will be very close to the exact unique count.\n\n        >>> df.nunique(approx=True)\n        A    3\n        B    1\n        dtype: int64\n        "
    from pyspark.pandas.series import first_series
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('axis should be either 0 or "index" currently.')
    sdf = self._internal.spark_frame.select(([SF.lit(None).cast(StringType()).alias(SPARK_DEFAULT_INDEX_NAME)] + [self._psser_for(label)._nunique(dropna, approx, rsd) for label in self._internal.column_labels]))
    with ps.option_context('compute.max_rows', 1):
        internal = self._internal.copy(spark_frame=sdf, index_spark_columns=[scol_for(sdf, SPARK_DEFAULT_INDEX_NAME)], index_names=[None], index_fields=[None], data_spark_columns=[scol_for(sdf, col) for col in self._internal.data_spark_column_names], data_fields=None)
        return first_series(DataFrame(internal).transpose())