Reconciling two systems (orders vs payments, CRM vs billing) means finding rows that don't match. Implement with pandas:
anti_join(left, right, on): rows of left whose on key does not appear in right, with the original columns and order and a fresh index.reconcile(orders, payments): both DataFrames have columns order_id and amount. Return a dict:
"missing_payment": sorted list of order ids with no payment"orphan_payment": sorted list of payment order ids with no order"amount_mismatch": sorted list of ids present in both where the amounts differ by more than 0.01 (sum payments per order first, since an order can be paid in several parts)