{
  "id": 15311754,
  "title": "Pairing inter-account transfers across bank statements with pandas",
  "url": "https://urgent.news/2026/10/18/pairing-inter-account-transfers-across-bank-statements-with-pandas",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-18T00:25:08.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/zerabooks/pairing-inter-account-transfers-across-bank-statements-with-pandas-1cm6"
  },
  "original_language": "en",
  "account": "To pair inter-account transfers across bank statements, match each outflow with an inflow of the same absolute amount in a different account within about three days, using each row only once. Work with integer cents. Left unpaired transfers can indicate missing accounts in bookkeeping or undiscovered accounts in divorce proceedings. When dealing with transactions from multiple accounts belonging to one household or business, many rows represent the same money changing hands. Pandas can handle the complexities involved.\n\nThe input for this script is one DataFrame, with one row per transaction, where money out is represented as a negative number. This format is typically achieved by downloading several converted statements into a single file, including an account column.\n\nTo find candidate transfer pairs in pandas, separate the outflows and inflows into two DataFrames. Convert the date column to datetime format, and multiply the amount column by 100, round, and convert it to integer cents. This ensures accurate comparisons. Name the outflow DataFrame 'outs' and the inflow DataFrame 'ins'.\n\nCreate a 'key' column to identify matching pairs. Set 'outs[key]' to the negative of 'outs[cents]' and 'ins[key]' to 'ins[cents]'. Match outflows with inflows using the 'key' column. The most crucial rule is that the money must change accounts. Any matches between accounts should be discarded. Calculate the lag (difference in days) between the outflow and inflow dates, and keep only those pairs with a lag between 0 and 3 days.\n\nUsing the last two sample rows as an example, a 650.00 card payment and a 650.00 deposit made two days apart in the same account will be paired. However, without the account rule, this could result in an unexplained card payment disappearing from the list. The rule enforcing a change in accounts is essential to ensure accurate findings. Lastly, sort the candidate pairs by lag and outflow date to ensure each row is paired only once.",
  "summary": "To pair inter-account transfers across bank statements, match each outflow to an inflow of the same absolute amount , in a different account , within about 3 days , and use each row only once. Work in integer cents. Transfers left unpaired are the finding: in bookkeeping a missing account in your setup, in divorce disclosure an account nobody has produced. When you have transactions from several…",
  "key_points": [
    "Pair inter-account transfers across bank statements using pandas",
    "Match each outflow with an inflow of the same absolute amount within 3 days",
    "Ensure money changes accounts by discarding same-account matches"
  ],
  "editors_take": "Automating the identification of inter-account transfers through pandas streamlines forensic bookkeeping by exposing missing accounts or hidden assets during complex financial investigations like divorce proceedings.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}