First of all, hi Stackoverflow.. I'm new here and will try to write a question to the best of my abilities.
I have the following DF:
**Adress Postalcode City
0 Hammer Landstraße 91 41460 Neuss 41460 Neuss
1 Grebbeberglaan 15 unit 5 B 3527VX Utrecht 3527VX Utrecht
2 Brink 88b 7411 BX, Deventer Nederland 7411 BX Deventer
3 Flevolaan 58 Postbus 399 1380 AJ Weesp 1380 AJ Weesp
I'm trying to filter the Adress column based on the Postalcode and City values! I just don't know how :(
My desired output will then be:
**Adress Postalcode City
0 Hammer Landstraße 91 41460 Neuss
1 Grebbeberglaan 15 unit 5 B 3527VX Utrecht
2 Brink 88b Nederland 7411 BX Deventer
3 Flevolaan 58 Postbus 399 1380 AJ Weesp
I've tried the following:
df1['Adress'] = filter(lambda i: not regex.search(df1[Postalcode]), df1[str('Adress')]).
So I want to keep all rows but update (read: remove) the values of the Adress column based on the values of the other two columns.
However this returns filter objects of df1 Adress column. Can any of you guys help me?
Any tips for me to improve asking questions are always welcome!