Created
December 13, 2017 15:20
-
-
Save samkit-jain/1695766968acd63dd07823814b027146 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initializing variables | |
transactions = [] # list to store single row entries | |
d_i = index of date column # from BANK_DETAILS | |
p_i = index of particular column # from BANK_DETAILS | |
# iterate over all transactions | |
for v_t in valid_transactions: | |
# date exists in the row | |
if v_t[d_i] is not None: | |
transactions.append(v_t) | |
# date empty, multiline particular | |
else: | |
# add v_t's particular to last entry in transactions | |
transactions[-1][p_i] += v_t[p_i] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment