Get specific stops
We may only want the information for a specific set of stops. We could either
filter the larger datasets returned by the other functions, or use the
naptan.get_specific_stops
function and let it do the work.
For example, to get the data for the stop outside St Paul's Cathedral in London,
we pass the stop's ATCO code to naptan.get_specific_stops
. In this case, the
stop's code is 490012873B
.
Info
This function requires a list be passed into the stops
parameter. Even just for a single stop.
Also, the code must passed in as a string.
Copied!
import naptan
# note: passed in as a string inside a list
naptan.get_specific_stops(['490012873B'])
import naptan
# note: passed in as a string inside a list
naptan.get_specific_stops(['490012873B'])
ATCOCode | NaptanCode | PlateCode | CleardownCode | CommonName | CommonNameLang | ShortCommonName | ShortCommonNameLang | Landmark | LandmarkLang | ... | TimingStatus | DefaultWaitTime | Notes | NotesLang | AdministrativeAreaCode | CreationDateTime | ModificationDateTime | RevisionNumber | Modification | Status | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14918 | 490012873B | 49762 | NaN | NaN | St Paul's Cathedral | NaN | NaN | NaN | --- | NaN | ... | OTH | NaN | NaN | NaN | 82 | 2016-06-02T16:07:07 | 2022-01-06T14:54:07 | 1 | revise | active |
1 rows × 43 columns
We can pass in an arbitrary number of stops to the function. For example, below we pass in some more of the stops surrounding St Paul's.
Copied!
import naptan
# note: passed in as a string inside a list
st_pauls_stops = ['490012873B', '490012873A', '490010199D', '490010199E']
naptan.get_specific_stops(st_pauls_stops)
import naptan
# note: passed in as a string inside a list
st_pauls_stops = ['490012873B', '490012873A', '490010199D', '490010199E']
naptan.get_specific_stops(st_pauls_stops)
ATCOCode | NaptanCode | PlateCode | CleardownCode | CommonName | CommonNameLang | ShortCommonName | ShortCommonNameLang | Landmark | LandmarkLang | ... | TimingStatus | DefaultWaitTime | Notes | NotesLang | AdministrativeAreaCode | CreationDateTime | ModificationDateTime | RevisionNumber | Modification | Status | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11502 | 490010199D | 53973 | NaN | NaN | New Change Cannon Street | NaN | NaN | NaN | --- | NaN | ... | OTH | NaN | NaN | NaN | 82 | 2016-03-07T14:50:08 | 2016-03-07T14:50:08 | 0 | revise | active |
11503 | 490010199E | 47995 | NaN | NaN | New Change Cannon Street | NaN | NaN | NaN | --- | NaN | ... | OTH | NaN | NaN | NaN | 82 | 2016-03-07T14:50:08 | 2016-03-07T14:50:08 | 0 | revise | active |
14917 | 490012873A | 53477 | NaN | NaN | St Paul's Cathedral | NaN | NaN | NaN | --- | NaN | ... | OTH | NaN | NaN | NaN | 82 | 2016-06-02T16:07:07 | 2022-01-06T14:54:07 | 1 | revise | active |
14918 | 490012873B | 49762 | NaN | NaN | St Paul's Cathedral | NaN | NaN | NaN | --- | NaN | ... | OTH | NaN | NaN | NaN | 82 | 2016-06-02T16:07:07 | 2022-01-06T14:54:07 | 1 | revise | active |
4 rows × 43 columns