Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
str.endswith Output Query
#8
Hi buran,

I have solved the issues I was having :-

For filtering the Rows, by multiple matching days of the Month, from all Months :-

Instead of using this line of Code :-

(df3['DATE'].str.endswith('-6','-8'))
I now use the following :-

(df3['DATE'].str.contains('-6$|-8$'))
And for Filtering Rows, for the same Day of the Month from all Months.

I now use :-

(df3['DATE'].str.contains('-6$'))
'$' Is used to match the end of a String, you know that no doubt, I found a Stackoverflow Forum Post
that mentioned that.

And now I get the correct DataFrame Output ))

And for filtering by multiple Months I use :-

(df3['DATE'].str.contains('-6-|-8-'))
And that works too. That would show all Rows, from June and August for example.

Many thanks for your help.

Best Regards

Eddie Winch Smile
Reply


Messages In This Thread
str.endswith Output Query - by eddywinch82 - Aug-18-2020, 07:15 PM
RE: str.endswith Output Query - by buran - Aug-18-2020, 07:19 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-18-2020, 07:30 PM
RE: str.endswith Output Query - by buran - Aug-18-2020, 08:09 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-18-2020, 08:32 PM
RE: str.endswith Output Query - by buran - Aug-18-2020, 08:40 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-18-2020, 09:28 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-19-2020, 12:18 AM
RE: str.endswith Output Query - by eddywinch82 - Aug-21-2020, 11:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Query output in Tuple paulo79 2 2,965 Apr-07-2022, 12:54 PM
Last Post: paulo79
  Format SQL Query Output phillyfa 2 6,106 Apr-22-2020, 07:45 AM
Last Post: buran
  syntax for endswith a digit birdieman 2 6,900 Mar-04-2017, 07:21 PM
Last Post: birdieman

Forum Jump:

User Panel Messages

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