[Python] how to detect repeated payment and decompose

Discussão em 'Python' iniciado por Stack, Janeiro 20, 2025.

  1. Stack

    Stack Membro Participativo

    I have data recording an account's incoming payments based on periodic patterns - weekly, biweekly or monthly - 3 months. Here is an example (all other dates have 0 in amount):

    Date amount
    2024-07-01 5107.68
    2024-07-08 5107.63
    2024-07-15 5107.61
    2024-07-22 5107.62
    2024-07-29 1500.00
    2024-07-29 5107.62
    2024-08-05 5107.61
    2024-08-12 5107.63
    2024-08-19 5107.61
    2024-08-26 1500.00
    2024-08-26 5107.62
    2024-09-03 5107.62
    2024-09-09 5107.61
    2024-09-16 5107.63
    2024-09-23 1500.00
    2024-09-23 5107.61
    2024-09-30 5107.62

    From above data, I should say the account was receiving two types of payments:

    1. weekly payment ~5107
    2. monthly (or every 4 weeks) payment 1500

    this is only one account without noise. The amount and payment periods for other account may have noise (for example, accasionally payments like 50). I am struggling how to detect the payment types and average amount for each type. Please help me out!

    Thank you!

    Continue reading...

Compartilhe esta Página