Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

156 write functions to extract survey results data from the database #161

Conversation

jimenasalinas
Copy link
Contributor

@jimenasalinas jimenasalinas commented May 21, 2024

Wrote 6 functions that calculate the following metrics to display survey results:

  1. number of responses
  2. percentage of people who responded and are frequent users
  3. avg rider satisfaction from answers
  4. count of responses by transit mode
  5. count of responses by time of day
  6. suggested improvements from users who own a car
  7. suggested improvements from users who don't own a car

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}

@jimenasalinas jimenasalinas merged commit f638ae2 into main May 21, 2024
1 check failed
@jimenasalinas jimenasalinas deleted the 156-Write-functions-to-extract-survey-results-data-from-the-database branch May 21, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants