Historical
HistoricalTrips
Source code in lyft_bikes/historical/historical.py
get_months_trips(year, month)
Return pandas.DataFrame for a given year and month
read(start_date, start_time_col='started_at', end_date=None)
Return historical trips for a given range of dates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_date |
str
|
start date for the data in %Y-%m-%d format |
required |
start_col_col |
column name for the start time |
required | |
end_date |
Union[str, None]
|
end date in the same format. Defaults to last date available |
None
|
Returns:
Type | Description |
---|---|
pd.DataFrame
|
Historical trip DataFrame for the date range provided. |
Examples:
Read trips from Jan 1st 2021 until Feb 1st 2021
>>> trips = HistoricalTrips()
>>> df_trips = trips.read(start_date="2021-01-01", end_date="2021-02-01")
Read trips from Jan 1st 2021 until the last date available