Forgive what is likely an elementary question, but I'm struggling to parse a .csv file into a list. Within the "For" loop, I get the full list of items I want, but outside of it, it only returns the last iterated row.
'''
for i in subset.index:
alta = pd.DataFrame()
transactions = []
transactions.append(subset['Date'][i])
transactions.append(subset['Credit Amount'][i])
transactions.append(subset['Debit Amount'][i])
transactions.append(subset['Description'][i])
print(transactions)
'''
This returns the below:
'''
['9/28/2018', nan, 46494533.33, 'SWEEP TO TREAS REPO I']
['9/28/2018', 46521123.39, nan, 'Invest-SWEEP TREASURY REPO - ICBC']
['9/28/2018', nan, 26590.06, 'SENDER BNK:=SIL VLY BK SCLA; SENDER ID:=121140399; SENDER REF:=20172799961800; ORG ID:=3300000000; ORG:=HL ADVISORS; ORG ADDRESS:=PO BOX 1 NEW YORK']
['9/28/2018', 10150015.1, nan, 'SENDER BNK:=SIL VLY BK SCLA; SENDER ID:=121140399; SENDER REF:=201809280156999; ORG ID:=3300000000; ORG:=WB ADVISORS; ORG ADDRESS:=PO BOX 1 NEW YORK']
['9/28/2018', nan, 35.0, nan]
['9/28/2018', nan, 670000.0, nan]
'''
When I run 'print(transactions" out side the "For" loop, I only get the below:
['9/28/2018', nan, 670000.0, nan]
Any suggestions are much appreciated!