May-04-2018, 05:06 PM
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.
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.