Python Forum
Help iterating through DictReader loaded from csv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help iterating through DictReader loaded from csv
#5
Thanks for the replies. They will be helpful in the long run.
I'm still not sure how to handle the loops to get the totals I need...

eat_count - A person_id has a visit entry other than check_in and other than cancelled, the eat_count is incremented. A person_id with no entries in the other columns does not count. person_id 80 has no values in the other columns and does not count here.

no_eat_count a person_id has only visits equal check_in and/or cancelled, the no_eat_count is incremented. person_id 80 counts here.

Each person_id should only have one count.

The output should be…
eat_count = 3
no_eat_count = 3

I know it should be simple, but I don't yet grasp how to work with lists in Python.
Can anyone help?
Thanks.
Reply


Messages In This Thread
RE: Help iterating through DictReader loaded from csv - by Huck - May-04-2018, 05:06 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020