I am trying to remove a string from a column using regular expressions and replace.
Name
"George @ ACkDk02gfe" sold
I want to remove " @ ACkDk02gfe"
I have tried several different variations of the code below, but I cant seem to remove string I want.
df['Name'] = df['Name'].str.replace('(\@\D+\"$)','')
The output should be
George sold
This portion of the string "ACkDk02gfe is entirely random.

str.replaceuses regex already; the problem is with the pattern OP has posted and I'm working on writing a correct answer now.df['Name'].str.replace('"','').replace('@\s\w+\s','', regex=True)?regexisTrueby default and you could combine the patterns into one, but yes, that would work as well as someone just copied your pattern into their answer 😂