Skip to content

Instantly share code, notes, and snippets.

@mmuratarat
Created November 2, 2023 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmuratarat/8da995277c9154e30da0a11bc5c4297f to your computer and use it in GitHub Desktop.
Save mmuratarat/8da995277c9154e30da0a11bc5c4297f to your computer and use it in GitHub Desktop.
import re
def tr_upper(self):
self = re.sub(r"i", "İ", self)
self = re.sub(r"ı", "I", self)
self = re.sub(r"ç", "Ç", self)
self = re.sub(r"ş", "Ş", self)
self = re.sub(r"ü", "Ü", self)
self = re.sub(r"ğ", "Ğ", self)
self = re.sub(r"â", "a", self)
self = self.upper() # for the rest use default upper
return self
df_cities['name'] = df_cities['name'].map(lambda x: tr_upper(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment