I have a list
['Paris, 458 boulevard Saint-Germain', 'Marseille, 29 rue Camille Desmoulins', 'Marseille, 1 chemin des Aubagnens']
i want split after keyword "boulevard, rue, chemin" like in output
['Saint-Germain', 'Camille Desmoulins', 'des Aubagnens']
Thanks for your time
It's not working because you are only extracting one word after you split:
due to
[3]
.Try
[3:]
instead. Ah, but that still won't be enough, because you'll get a list of lists, when you want a list of strings. So you also need to usejoin
.Now your only difficulty is dealing with irregular street addresses, e.g. people who don't have a house number, or several words in the street name. I have no solution for that!