Skip to content

DOC: Fixed examples in pandas/core/accessor.py #33260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then

# Individual files

MSG='Doctests accessor.py' ; echo $MSG
pytest -q --doctest-modules pandas/core/accessor.py
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Doctests base.py' ; echo $MSG
pytest -q --doctest-modules pandas/core/base.py
RET=$(($RET + $?)) ; echo $MSG "DONE"
Expand Down
13 changes: 7 additions & 6 deletions pandas/core/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,13 @@ def plot(self):

Back in an interactive IPython session:

>>> ds = pd.DataFrame({{'longitude': np.linspace(0, 10),
... 'latitude': np.linspace(0, 20)}})
>>> ds.geo.center
(5.0, 10.0)
>>> ds.geo.plot()
# plots data on a map
.. code-block:: ipython

In [1]: ds = pd.DataFrame({{"longitude": np.linspace(0, 10),
...: "latitude": np.linspace(0, 20)}})
In [2]: ds.geo.center
Out[2]: (5.0, 10.0)
In [3]: ds.geo.plot() # plots data on a map
"""

def decorator(accessor):
Expand Down