I've got a column in dataframe I want to clean up by removing the brackets.
1 Auburn (Auburn University)[1]
2 Florence (University of North Alabama)
3 Jacksonville (Jacksonville State University)[2]
4 Livingston (University of West Alabama)[2]
5 Montevallo (University of Montevallo)[2]
6 Troy (Troy University)[2]
7 Tuscaloosa (University of Alabama, Stillman Co...
8 Tuskegee (Tuskegee University)[5]
10 Fairbanks (University of Alaska Fairbanks)[2]
12 Flagstaff (Northern Arizona University)[6]
I used unitowns['City'].str.replace('\(.*\)','').str.replace('\[.*\]','') to get the intended result as follows-
1 Auburn
2 Florence
3 Jacksonville
4 Livingston
5 Montevallo
6 Troy
7 Tuscaloosa
8 Tuskegee
10 Fairbanks
12 Flagstaff
Is there a way to combine these expressions? This code does not seem to work -> unitowns['City'].str.replace('(\(.*\)) | (\[.*\])','')