pandas / 0.25.0 / reference / api / pandas.series.str.translate.html /

pandas.Series.str.translate

Series.str.translate(self, table) [source]

Map all characters in the string through the given mapping table. Equivalent to standard str.translate().

Parameters:
table : dict

table is a mapping of Unicode ordinals to Unicode ordinals, strings, or None. Unmapped characters are left untouched. Characters mapped to None are deleted. str.maketrans() is a helper function for making translation tables.

Returns:
Series or Index

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.Series.str.translate.html