0

Imagine you have the following df:

dffinal =  {'BTW': '2.81', 'ExclBTW': '31.17', Totaal: '33.98'}

    BTW     ExclBTW Totaal  
0   2.81    31.17   33.98   

dtype:

I want to do a reconciliation check on these numbers, such that Totaal equals ExclBTW + BTW:

dffinal['VATcheck'] = np.where(dffinal['Totaal'].astype('float') == (dffinal['ExclBTW'].astype(float) + dffinal['BTW'].astype(float)), True, False)

However, the VATcheck returns False, while 2.81 + 31.17 = 33.98:

     BTW    ExclBTW Totaal  VATcheck
0   2.81    31.17   33.98   False

What am I doing wrong here?

Please help!

Max
  • 493
  • 2
  • 9

0 Answers0