Skip to content

Instantly share code, notes, and snippets.

@ChicagoDev
Created April 12, 2019 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChicagoDev/c9129021099040ec1b5acd740e8f3711 to your computer and use it in GitHub Desktop.
Save ChicagoDev/c9129021099040ec1b5acd740e8f3711 to your computer and use it in GitHub Desktop.
def __init__(self, mta_week_numbers):
"""
MtaRidership class constructor
:param mta_week_numbers: A list of YYMMDD strings for the turnstile week files to load.
:return: MtaRidership
"""
self.turnstiles_df = []
self.turnstiles_daily = []
self.get_data(mta_week_numbers)
self.bootstrap()
def bootstrap(self):
"""
Called by __init__. Logic for parsing MTA data.
:return: None
"""
self.format_columns()
self.remove_duplicates()
self.drop_misc_columns()
self.group_by_station_and_date()
self.count_ridership()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment