156 write functions to extract survey results data from the database #161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wrote 6 functions that calculate the following metrics to display survey results:
Output example for checking against db records:
Number of responses NY: 22
Avg rider satisfaction NY: 3.8
% transit use NY: 50.0
Count responses by transit mode NY: {'Bus': 4, 'Train': 4, 'Car': 2, 'Bike': 1, 'Walking': 6, 'Rideshare': 1}
Count responses by time of day NY: {'Peak commute hours': 8, 'Daytime': 9, 'Nighttime': 1}
Count improvement suggestions from people with a car NY: {'More frequent service': 1, 'More accurate schedule times': 0, 'Fewer transfers or a more direct route': 0, 'It feels safe at the station and onboard': 0, 'No improvement needed': 0}
Count improvement suggestions from people without a car NY: {'More frequent service': 0, 'More accurate schedule times': 2, 'Fewer transfers or a more direct route': 2, 'It feels safe at the station and onboard': 0, 'No improvement needed': 1}
Number of responses Chicago: 10
Avg rider satisfaction Chicago: 3.0
% transit use Chicago: 40.0
Count responses by transit mode Chicago: {'Bus': 3, 'Train': 0, 'Car': 3, 'Bike': 1, 'Walking': 2, 'Rideshare': 0}
Count responses by time of day Chicago: {'Peak commute hours': 4, 'Daytime': 2, 'Nighttime': 3}
Count improvement suggestions from people with a car Chicago: {'More frequent service': 0, 'More accurate schedule times': 0, 'Fewer transfers or a more direct route': 0, 'It feels safe at the station and onboard': 0, 'No improvement needed': 0}
Count improvement suggestions from people without a car Chicago: {'More frequent service': 0, 'More accurate schedule times': 2, 'Fewer transfers or a more direct route': 1, 'It feels safe at the station and onboard': 0, 'No improvement needed': 0}