Python Forum
Using Regex Expression With Isin in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Regex Expression With Isin in Python
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [solved] Regex expression do not want to taken :/ SpongeB0B 2 761 Nov-06-2023, 02:43 PM
Last Post: SpongeB0B
  Python beginner that needs an expression added to existing script markham 1 707 Sep-04-2023, 05:24 AM
Last Post: Pedroski55
  Regex Include and Exclude patterns in Same Expression starzar 2 792 May-23-2023, 09:12 AM
Last Post: Gribouillis
  Python Regex quest 2 2,351 Sep-22-2022, 03:15 AM
Last Post: quest
  Regex Expression With Code Query In Pandas eddywinch82 8 2,343 Apr-13-2022, 09:12 AM
Last Post: snippsat
  Dict and Isin JonahPython 1 1,941 Nov-05-2021, 07:52 PM
Last Post: deanhystad
  Problem in Regex Expression shantanu97 2 1,715 Sep-28-2021, 03:40 AM
Last Post: shantanu97
  python regex: get rid of double dot wardancer84 4 2,365 Sep-09-2021, 03:03 PM
Last Post: wardancer84
  Python Regular expression, small sample works but not on file Acernz 5 2,940 Jun-09-2021, 08:27 PM
Last Post: bowlofred
  2 regex expression at a time tokstolle 2 2,086 May-27-2020, 05:00 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020