Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Reconciling Transactions with Python | Automating Accounting Workflows
Python for Accountants

bookReconciling Transactions with Python

1234567891011121314151617181920212223242526
import pandas as pd # Sample bank transactions bank_data = { "Date": ["2024-06-01", "2024-06-02", "2024-06-03"], "Description": ["Deposit", "Withdrawal", "Payment"], "Amount": [1000, -200, -150] } bank_df = pd.DataFrame(bank_data) # Sample ledger transactions ledger_data = { "Date": ["2024-06-01", "2024-06-02", "2024-06-04"], "Description": ["Deposit", "Withdrawal", "Fee"], "Amount": [1000, -200, -50] } ledger_df = pd.DataFrame(ledger_data) # Merge on all columns to find exact matches merged = pd.merge(bank_df, ledger_df, how="outer", indicator=True) # Find transactions not matched in both datasets unmatched = merged[merged["_merge"] != "both"] print("Unmatched transactions:") print(unmatched)
copy
1234567891011121314151617181920
import pandas as pd # Example datasets bank = pd.DataFrame({ "Date": ["2024-06-01", "2024-06-02"], "Amount": [500, -100] }) ledger = pd.DataFrame({ "Date": ["2024-06-01", "2024-06-03"], "Amount": [500, -50] }) # Merge and flag discrepancies merged = pd.merge(bank, ledger, on=["Date", "Amount"], how="outer", indicator=True) discrepancies = merged[merged["_merge"] != "both"] # Report discrepancies for idx, row in discrepancies.iterrows(): source = "Bank" if row["_merge"] == "left_only" else "Ledger" print(f"Discrepancy found in {source}: Date {row['Date']}, Amount {row['Amount']}")
copy
question mark

Select the correct answer

question mark

Select the correct answer

question-icon
A B _merge
1 2 4 left_only
2 3 5 right_only

Click or drag`n`drop items and fill in the blanks

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 3

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

bookReconciling Transactions with Python

Svep för att visa menyn

1234567891011121314151617181920212223242526
import pandas as pd # Sample bank transactions bank_data = { "Date": ["2024-06-01", "2024-06-02", "2024-06-03"], "Description": ["Deposit", "Withdrawal", "Payment"], "Amount": [1000, -200, -150] } bank_df = pd.DataFrame(bank_data) # Sample ledger transactions ledger_data = { "Date": ["2024-06-01", "2024-06-02", "2024-06-04"], "Description": ["Deposit", "Withdrawal", "Fee"], "Amount": [1000, -200, -50] } ledger_df = pd.DataFrame(ledger_data) # Merge on all columns to find exact matches merged = pd.merge(bank_df, ledger_df, how="outer", indicator=True) # Find transactions not matched in both datasets unmatched = merged[merged["_merge"] != "both"] print("Unmatched transactions:") print(unmatched)
copy
1234567891011121314151617181920
import pandas as pd # Example datasets bank = pd.DataFrame({ "Date": ["2024-06-01", "2024-06-02"], "Amount": [500, -100] }) ledger = pd.DataFrame({ "Date": ["2024-06-01", "2024-06-03"], "Amount": [500, -50] }) # Merge and flag discrepancies merged = pd.merge(bank, ledger, on=["Date", "Amount"], how="outer", indicator=True) discrepancies = merged[merged["_merge"] != "both"] # Report discrepancies for idx, row in discrepancies.iterrows(): source = "Bank" if row["_merge"] == "left_only" else "Ledger" print(f"Discrepancy found in {source}: Date {row['Date']}, Amount {row['Amount']}")
copy
question mark

Select the correct answer

question mark

Select the correct answer

question-icon
A B _merge
1 2 4 left_only
2 3 5 right_only

Click or drag`n`drop items and fill in the blanks

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 3
some-alt