I have a pandas data frame data with several columns. One of these columns is GEN. This column contains german cities as strings. Some of these cities are in a bad format, meaning that they have values like "Frankfurt a.Main". For every element in data['GEN'] I would like to replace every expression of the form "\.[A-ZÄÖÜ]" (i.e. dot followed by upper case letter) by the corresponding expression "\.\b[A-ZÄÖÜ]". For example
"Frankfurt a.Main"becomes"Frankfurt a. Main""Frankfurt a.d.Oder"becomes"Frankfurt a.d. Oder"and so on.
I am pretty sure that pandas.Series.str.contains and pandas.Series.str.replace are helpful here, but one of my problems is that I don't know how to put the replacement task in a form that can be used by the above functions.