Issue
Goal: prevent Â
from appearing in Dataframe .csv.
val = f"£{format(r.randint(200, 10000), ',')}"
val = '£' + format(r.randint(200, 10000), ',')
val = str(f"£{format(r.randint(200, 10000), ',')}")
val = str('£' + format(r.randint(200, 10000), ','))
Example Output:
£2,213
Solution
The character £ is Unicode code point U+00A3, which has a two-byte UTF-8 encoding of C2 A3. Your terminal, though, is using a different encoding (e.g. ISO-8859), which treats this as two separate characters, Â and £. You’ll need to fix your terminal to use UTF-8 instead to display the text as intended.
Answered By – chepner
Answer Checked By – Mildred Charles (BugsFixing Admin)