w3resource

Pandas DataFrame: applymap() function

DataFrame - applymap() function

The applymap() function is used to apply a function to a Dataframe elementwise.

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

Syntax:

DataFrame.applymap(self, func)

Parameters:

Name Description Type/Default Value Required / Optional
func Python function, returns a single value from a single value. callable Required

Returns:DataFrame
Transformed DataFrame.

Example:


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - apply() function
Next: DataFrame - pipe() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/pandas/dataframe/dataframe-applymap.php