Python Forum
Using Regex Expression With Isin in Python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Using Regex Expression With Isin in Python (/thread-33141.html)



Using Regex Expression With Isin in Python - eddywinch82 - Apr-04-2021

Hi there,

I am using the following Line Of Code, in Pandas :-

diff = df6.loc[~df6['Venue'].isin(df1['Venue'])]
diff
And I am not getting the Output result I want.

I wan't to have the DataFrame Rows Showing, where any Rows in the Venue Column, which have common words
in both DataFrame are omitted. I.e. the Rows in Both DataFrames, will in one DataFrame have a Row for example, saying Mildenhall in the Venue Column, and in another row in the other DataFrame, say Mildenhall Airshow or have Mildenhall followed by other words in the Row, in the Venue Column. The Same for other Rows, so here I wan't only Rows in df6, that don't have the same Word, i.e. matching word, in the Venue Column compared with the other DataFrame df1 showing in the DataFrame output.

I assume I would need a Regex Expression, to achieve this, and if so, what would the new Line of Python Code look like ?

Any help would be much appreciated.

Best Regards

Eddie Winch