Skip to content

DOC: Fix PEP-8 issues in sparse.rst #23907

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
Nov 25, 2018
Merged
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
13 changes: 7 additions & 6 deletions doc/source/sparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
:suppress:

import numpy as np
np.random.seed(123456)
import pandas as pd
import pandas.util.testing as tm

np.random.seed(123456)
np.set_printoptions(precision=4, suppress=True)
pd.options.display.max_rows = 15

Expand All @@ -26,7 +26,7 @@ data structures have a ``to_sparse`` method:

.. ipython:: python

ts = pd.Series(randn(10))
ts = pd.Series(np.random.randn(10))
ts[2:-2] = np.nan
sts = ts.to_sparse()
sts
Expand All @@ -44,7 +44,7 @@ large, mostly NA ``DataFrame``:

.. ipython:: python

df = pd.DataFrame(randn(10000, 4))
df = pd.DataFrame(np.random.randn(10000, 4))
df.iloc[:9998] = np.nan
sdf = df.to_sparse()
sdf
Expand Down Expand Up @@ -94,7 +94,8 @@ distinct from the ``fill_value``:
.. ipython:: python

arr = np.random.randn(10)
arr[2:5] = np.nan; arr[7:8] = np.nan
arr[2:5] = np.nan
arr[7:8] = np.nan
sparr = pd.SparseArray(arr)
sparr

Expand Down Expand Up @@ -244,7 +245,7 @@ The method requires a ``MultiIndex`` with two or more levels.
(1, 1, 'b', 1),
(2, 1, 'b', 0),
(2, 1, 'b', 1)],
names=['A', 'B', 'C', 'D'])
names=['A', 'B', 'C', 'D'])

s
# SparseSeries
Expand Down