Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding sequential invoice
#1
Hi,

I have the following dataframe and I would need to find the sequential invoice from each same name. Can kindly advise? Thanks.

data={'myid':[1,2,3,4,5,6],'name':['Mary','John','John','Peh','Alex','ken'],'invoice':['INV001','INV003','INV004','INV007','GAA002','INV008']}
df=pd.DataFrame(data)
df
The following are the result. John has squential invoice of INV003 and INV004. INV007 and INV008 although is sequential but was not from same person.

result={'myid':[2,3],'name':['John','John'],'invoice':['INV003','INV004']}
df_result=pd.DataFrame(result)
df_result
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sequential number for rows retrieved and storing the Primary UKey to the line number GYKR 2 555 Aug-22-2023, 10:14 AM
Last Post: GYKR
  Print Report Invoice nio74maz 0 1,536 Jun-17-2021, 08:25 AM
Last Post: nio74maz
  How to add previous date infront of every unique customer id's invoice date ur_enegmatic 1 2,190 Feb-06-2021, 10:48 PM
Last Post: eddywinch82
  Four sequential bytes; Need to remove high order bit in each to get correct output GrandSean 5 2,884 Feb-06-2021, 07:17 PM
Last Post: GrandSean
  Create a sequential number (counter) and reset at each duplicate Mekala 0 1,703 Sep-20-2020, 05:02 AM
Last Post: Mekala
  Sequential color background swisha 2 1,984 Mar-05-2020, 03:43 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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