Skip to content

Commit c85c064

Browse files
michaelgrundwillschlitzerseisman
authored
Add inline example for select (#1756)
Co-authored-by: Will Schlitzer <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
1 parent c6036c4 commit c85c064

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pygmt/src/select.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,19 @@ def select(data=None, outfile=None, **kwargs):
147147
- :class:`pandas.DataFrame` table if ``outfile`` is not set.
148148
- None if ``outfile`` is set (filtered output will be stored in file
149149
set by ``outfile``).
150+
151+
Example
152+
-------
153+
>>> import pygmt # doctest: +SKIP
154+
>>> # Load a table of ship observations of bathymetry off Baja California
155+
>>> data = pygmt.datasets.load_sample_data(
156+
... name="bathymetry"
157+
... ) # doctest: +SKIP
158+
>>> # Only return the data points that lie within the region between
159+
>>> # longitudes 246 and 247 and latitudes 20 and 21
160+
>>> pygmt.select(
161+
... data=ship_data, region=[246, 247, 20, 21]
162+
... ) # doctest: +SKIP
150163
"""
151164

152165
with GMTTempFile(suffix=".csv") as tmpfile:

0 commit comments

Comments
 (0)