One of the basic tasks in data transformations is the mapping of a set of values to another set. Pandas provides a generic ability to map values using a lookup table (via a Python dictionary or a pandas Series) using the .map() method.
This method performs the mapping by first matching the values of the outer Series with the index labels of the inner Series. It then returns a new Series, with the index labels of the outer Series but the values from the inner Series.
The following example shows how to map the labels in the index of x to the values of y:
As with other alignment operations, if pandas does ...