I have a dataframe which has, in a certain column, a check mark (unicode: '\u2714'). I have been trying to replace it with the following coomand:
import unicodedata
df['Column'].str.replace(unicodedata.lookup("\u2714"), '')
But, i keep on reading this error: KeyError: "undefined character name '✔'".
Do you have an idea how to solve this?
check mark (unicode: '\u2714')
No. This is
SMALL ROMAN NUMERAL FIVE
.unicodedata.lookup
should be feed with Unicode name of character, not character itself. You might use.str.replace
with Unicode characters directly, so rather thanyou might do
simple example
output