Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.Series.str.translate#

Series.str.translate(table)[source]#

Map all characters in the string through the given mapping table.

Equivalent to standardstr.translate().

Parameters:
tabledict

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

Returns:
Series or Index

Examples

>>>ser=pd.Series(["El niño","Françoise"])>>>mytable=str.maketrans({'ñ':'n','ç':'c'})>>>ser.str.translate(mytable)0   El nino1   Francoisedtype: object

[8]ページ先頭

©2009-2025 Movatter.jp