def applymap(self, func: Callable[([Any], Any)]) -> 'DataFrame':
    '\n        Apply a function to a Dataframe elementwise.\n\n        This method applies a function that accepts and returns a scalar\n        to every element of a DataFrame.\n\n        .. note:: this API executes the function once to infer the type which is\n             potentially expensive, for instance, when the dataset is created after\n             aggregations or sorting.\n\n             To avoid this, specify return type in ``func``, for instance, as below:\n\n             >>> def square(x) -> np.int32:\n             ...     return x ** 2\n\n             pandas-on-Spark uses return type hint and does not try to infer the type.\n\n        Parameters\n        ----------\n        func : callable\n            Python function, returns a single value from a single value.\n\n        Returns\n        -------\n        DataFrame\n            Transformed DataFrame.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame([[1, 2.12], [3.356, 4.567]])\n        >>> df\n               0      1\n        0  1.000  2.120\n        1  3.356  4.567\n\n        >>> def str_len(x) -> int:\n        ...     return len(str(x))\n        >>> df.applymap(str_len)\n           0  1\n        0  3  4\n        1  5  5\n\n        >>> def power(x) -> float:\n        ...     return x ** 2\n        >>> df.applymap(power)\n                   0          1\n        0   1.000000   4.494400\n        1  11.262736  20.857489\n\n        You can omit the type hint and let pandas-on-Spark infer its type.\n\n        >>> df.applymap(lambda x: x ** 2)\n                   0          1\n        0   1.000000   4.494400\n        1  11.262736  20.857489\n        '
    return self._apply_series_op((lambda psser: psser.apply(func)))
Apply a function to a Dataframe elementwise.

This method applies a function that accepts and returns a scalar
to every element of a DataFrame.

.. note:: this API executes the function once to infer the type which is
     potentially expensive, for instance, when the dataset is created after
     aggregations or sorting.

     To avoid this, specify return type in ``func``, for instance, as below:

     >>> def square(x) -> np.int32:
     ...     return x ** 2

     pandas-on-Spark uses return type hint and does not try to infer the type.

Parameters
----------
func : callable
    Python function, returns a single value from a single value.

Returns
-------
DataFrame
    Transformed DataFrame.

Examples
--------
>>> df = ps.DataFrame([[1, 2.12], [3.356, 4.567]])
>>> df
       0      1
0  1.000  2.120
1  3.356  4.567

>>> def str_len(x) -> int:
...     return len(str(x))
>>> df.applymap(str_len)
   0  1
0  3  4
1  5  5

>>> def power(x) -> float:
...     return x ** 2
>>> df.applymap(power)
           0          1
0   1.000000   4.494400
1  11.262736  20.857489

You can omit the type hint and let pandas-on-Spark infer its type.

>>> df.applymap(lambda x: x ** 2)
           0          1
0   1.000000   4.494400
1  11.262736  20.857489
def applymap(self, func: Callable[([Any], Any)]) -> 'DataFrame':
    '\n        Apply a function to a Dataframe elementwise.\n\n        This method applies a function that accepts and returns a scalar\n        to every element of a DataFrame.\n\n        .. note:: this API executes the function once to infer the type which is\n             potentially expensive, for instance, when the dataset is created after\n             aggregations or sorting.\n\n             To avoid this, specify return type in ``func``, for instance, as below:\n\n             >>> def square(x) -> np.int32:\n             ...     return x ** 2\n\n             pandas-on-Spark uses return type hint and does not try to infer the type.\n\n        Parameters\n        ----------\n        func : callable\n            Python function, returns a single value from a single value.\n\n        Returns\n        -------\n        DataFrame\n            Transformed DataFrame.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame([[1, 2.12], [3.356, 4.567]])\n        >>> df\n               0      1\n        0  1.000  2.120\n        1  3.356  4.567\n\n        >>> def str_len(x) -> int:\n        ...     return len(str(x))\n        >>> df.applymap(str_len)\n           0  1\n        0  3  4\n        1  5  5\n\n        >>> def power(x) -> float:\n        ...     return x ** 2\n        >>> df.applymap(power)\n                   0          1\n        0   1.000000   4.494400\n        1  11.262736  20.857489\n\n        You can omit the type hint and let pandas-on-Spark infer its type.\n\n        >>> df.applymap(lambda x: x ** 2)\n                   0          1\n        0   1.000000   4.494400\n        1  11.262736  20.857489\n        '
    return self._apply_series_op((lambda psser: psser.apply(func)))