invoice

Determinate Consecutive Values (Invoices) Pandas

Determinate Consecutive Values (Invoices) Pandas Question: I have a dataset with supplier and its invoices and I need to determinate which of the invoices are consecutives marking it with a 1 or a 0. For example: df1 = pd.DataFrame() df1[‘Supplier’] = [‘ABC’,’ABC’,’ABC’,’ABC’,’ABC’,’ABC’,’ABC’,’ABC’,’ABC’,’ABC’,’ABC’] df1[‘Invoice’] = [‘101′,’102′,’105′,’109′,’110′,’114′,’120′,’121′,’122′,’130′,’131’] Supplier Invoice 0 ABC 101 1 ABC 102 2 ABC …

Total answers: 4