Overview
read_historical_trips(start_date, city, end_date=None)
Read historical trips within given range of dates for a city.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_date |
str
|
start date for the data in %Y-%m-%d format |
required |
city |
str
|
city to read data from |
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 in Chicago
import lyft_bikes
df = lyft_bikes.read_historical_trips(
start_date="2021-01-01",
end_date="2021-02-01",
city="Chicago",
)
Source code in lyft_bikes/__init__.py
read_live_bikes(city)
Read currently available bikes and scooters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
city |
str
|
city to read data from |
required |
Returns:
Type | Description |
---|---|
pd.DataFrame
|
DataFrame with the current status of bikes and scooters. |
Source code in lyft_bikes/__init__.py
read_stations(city)
Read information and status for each station.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
city |
str
|
city to read data from |
required |
Returns:
Type | Description |
---|---|
pd.DataFrame
|
DataFrame with the stations information and status. |