I'm trying to replace specific characters in a data frame just if the string of the column starts with the characters specified. I mean, the df is as below:
| UBICACION | NAME |
|---|---|
| AL03 | Joe |
| FL03 | Maria |
| AL07 | Karla |
| DAL5 | Marco |
The desired output would be:
| UBICACION | NAME |
|---|---|
| FL03 | Joe |
| FL03 | Maria |
| FL07 | Karla |
| DAL5 | Marco |
This is my try:
df['UBICACION'] = df['UBICACION'].replace ("FL","AL")
The last sentence is not working, cause' it changes all the word, it just keeps the specified characters
Hope you can help me, I'm a little bit new on this. Best regards.