vendredi 31 juillet 2020

Python: Trouble looping through spreadsheet of application data to pull out info that meets parameters

I'm working on a midterm project for my grad class using a situation that I've had to deal with for my job which is sorting through CARES Act rental assistance applications.

My goal is to have applications that meet certain parameters be "sent" to two different departments (in this case I plan on doing TXT reports) and the rest to be filtered out further and sorted into more categories.

Right now I have the first part set as a lot of nested if/elif statements. My issue is that it's only reporting back one application. What do I need to use to have the code run through the entire list and report it all back either in a TXT file or in the shell?

So far I've only been working on the first part that ends at print (listFEA), so the other parts I haven't focused on yet.

I have tried opening a report as well, but didn't include it in this code because it didn't work.

    if caresValues [15] > "0":
        if caresValues [17] != "Yes":
            if caresValues [8] == "0":
                for i in caresValues:
                    listFEA.append(i)
                    print (listFEA)                    
        elif caresValues [18] != "Yes":
            if caresValues [8] != "0":
                print ("Refer to General Emergency Assistance.")
    if caresValues [15] == "0":
        print caresValues
                
else:
    print ("Refer to community provider.")```

Aucun commentaire:

Enregistrer un commentaire