Skip to content

Commit 164064d

Browse files
authored
DOC: Fixed examples in pandas/core/accessor.py (#33260)
1 parent 5e21be0 commit 164064d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

ci/code_checks.sh

+4
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
268268

269269
# Individual files
270270

271+
MSG='Doctests accessor.py' ; echo $MSG
272+
pytest -q --doctest-modules pandas/core/accessor.py
273+
RET=$(($RET + $?)) ; echo $MSG "DONE"
274+
271275
MSG='Doctests base.py' ; echo $MSG
272276
pytest -q --doctest-modules pandas/core/base.py
273277
RET=$(($RET + $?)) ; echo $MSG "DONE"

pandas/core/accessor.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,13 @@ def plot(self):
257257
258258
Back in an interactive IPython session:
259259
260-
>>> ds = pd.DataFrame({{'longitude': np.linspace(0, 10),
261-
... 'latitude': np.linspace(0, 20)}})
262-
>>> ds.geo.center
263-
(5.0, 10.0)
264-
>>> ds.geo.plot()
265-
# plots data on a map
260+
.. code-block:: ipython
261+
262+
In [1]: ds = pd.DataFrame({{"longitude": np.linspace(0, 10),
263+
...: "latitude": np.linspace(0, 20)}})
264+
In [2]: ds.geo.center
265+
Out[2]: (5.0, 10.0)
266+
In [3]: ds.geo.plot() # plots data on a map
266267
"""
267268

268269
def decorator(accessor):

0 commit comments

Comments
 (0)