I get this error whenever I try to run my code. I believe both the lists's summary_name
and summary
lists are not working.
Error:
File "C:/Users/Asus/Google Drive/Sun Gleam & Fine Works/System Improvement/Accounting/Voucher Reports/Voucher Reports", line 12, in <module>
summary_name[i] = data_listofaccounts['Account Name']
NameError: name 'summary_name' is not defined
Code:
import pandas as pd
import matplotlib.pyplot as plt
entries_csv = "C:\\Users\\Asus\\Desktop\\Entries.csv"
listofaccounts_csv = "C:\\Users\\Asus\\Desktop\\List of Accounts.csv"
data_entries = pd.read_csv(entries_csv)
data_listofaccounts = pd.read_csv(listofaccounts_csv)
i = 0
for account_name in data_listofaccounts['Account Name']:
summary_name[i] = data_listofaccounts['Account Name']
for debit_account in data_entries['DEBIT ACCOUNT']:
if account_name == debit_account:
summary[i] += data_entries['DEBIT AMOUNT']
i += 1
for p in range(i):
print(summary[p])
print(summary_name[p])