pandas.Series.str.normalize#
- Series.str.normalize(form)[source]#
Return the Unicode normal form for the strings in the Series/Index.
For more information on the forms, see the
unicodedata.normalize().- Parameters:
- form{‘NFC’, ‘NFKC’, ‘NFD’, ‘NFKD’}
Unicode form.
- Returns:
- Series/Index of objects
A Series or Index of strings in the same Unicode form specified by form. The returned object retains the same type as the input (Series or Index), and contains the normalized strings.
See also
Series.str.upperConvert all characters in each string to uppercase.
Series.str.lowerConvert all characters in each string to lowercase.
Series.str.titleConvert each string to title case (capitalizing the first letter of each word).
Series.str.stripRemove leading and trailing whitespace from each string.
Series.str.replaceReplace occurrences of a substring with another substring in each string.
Examples
>>> ser = pd.Series(["ñ"]) >>> ser.str.normalize("NFC") == ser.str.normalize("NFD") 0 False dtype: bool