Python Forum

Full Version: Using Regex Expression With Isin in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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