0

I haven't been studying python for so long and I can't cope with this task yet. It is advisable to use pandas to solve this problem since it was used throughout the program earlier

The program must have two dataframes for input.

1st CodeDF which looks like this: CodeDF

2nd InvoiceDF which looks like this: InvoiceDF

The program should output the modified InvoiceDF

The program receives two dataframes for input: The first dataframe is CodeDF, the second is InvoiceFD. The task of the program is to transfer information from the CodeDF dataframe to InvoiceDF using the following logic: In each of the dataframes there is an Article column (blue color) and in those rows in which the value of the Article corresponds in both dataframes, the program must transfer the values of Packages (yellow) and Single (Pink) of this stack from the CodeDF dataframe to Invoice DF. The logic of working with Quantity and Total (green) is a bit more complicated. The program needs to compare two values from Quantity and from Total, if they match, then do nothing, if they do not match, add the "False" test to the Quantity icon in this drain.

Earlier I was advised to use such a construction, but it does not work correctly

InvoiceDF[['Packages', 'Single']] = CodeDF[['Packages', 'Single']].loc[CodeDF['Article'].isin(InvoiceDF['Model'])].reset_index(drop=True)

0 Answers0