I have a dataframe to store cars related information and I am trying to replace certain key "[Pink & Blue]" to "[Pink&Blue]" to remove the space in between using regex but my code fails to do so :
Cars = {'Brand': ['Honda Civic','Toyota Corolla','Ford Focus'],
'Price': [22000,np.nan,35000] ,
'Product Summary' : ['color is [Pink & Blue] size is 14' ,'color is [Pink & Yellow] size is 10','color is [Red & Black] size is 11']
}
df = DataFrame(Cars,columns= ['Brand', 'Price', 'Product Summary'])
df['Product Summary'] = df['Product Summary'].replace(r'\b & ',"&")