Skip to content
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

BUG: Sparse misc fixes including __repr__ #12779

Closed
wants to merge 1 commit into from

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Apr 3, 2016

Fixes following issues.

# NG, should be SparseArray (categorized as API change)
a = pd.SparseArray([1, np.nan, np.nan, 3, np.nan])
type(a.take([1, 2]))
# numpy.ndarray

# NG
s = pd.Series([1, np.nan, np.nan, 3, np.nan]).to_sparse()
s.loc[[1, 3]]
# TypeError: reindex() got an unexpected keyword argument 'level'

# NG
s.iloc[2]
# IndexError: index out of bounds

# NG, must be SparseSeries (root cause of 10560)
type(s.iloc[2:])
# pandas.sparse.array.SparseArray

@sinhrks sinhrks added Indexing Related to indexing on series/frames, not to indexes themselves Output-Formatting __repr__ of pandas objects, to_string Sparse Sparse Data Type labels Apr 3, 2016
@sinhrks sinhrks added this to the 0.18.1 milestone Apr 3, 2016
@sinhrks sinhrks added the Bug label Apr 3, 2016
@kawochen kawochen mentioned this pull request Apr 3, 2016
18 tasks
@sinhrks sinhrks changed the title (WIP) BUG: Sparse misc fixes including __repr__ BUG: Sparse misc fixes including __repr__ Apr 3, 2016
@sinhrks
Copy link
Member Author

sinhrks commented Apr 3, 2016

xref: SparseDataFrame indexing #4400

@jreback
Copy link
Contributor

jreback commented Apr 3, 2016

@sinhrks awesome!

I repurposed #4400 to just be some addl tests.

@sinhrks sinhrks deleted the sparse_enh branch April 3, 2016 14:54
@jreback
Copy link
Contributor

jreback commented Apr 3, 2016

never saw this one before: https://travis-ci.org/pydata/pandas/jobs/120431675

jreback added a commit to jreback/pandas that referenced this pull request Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Output-Formatting __repr__ of pandas objects, to_string Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError in SparseSeries.__repr__ when series longer than max_rows
2 participants