Skip to content

API, DOC: SparseArray Interface and Documentation is Confusing #12794

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

Closed
gfyoung opened this issue Apr 4, 2016 · 13 comments
Closed

API, DOC: SparseArray Interface and Documentation is Confusing #12794

gfyoung opened this issue Apr 4, 2016 · 13 comments
Labels
Docs Sparse Sparse Data Type
Milestone

Comments

@gfyoung
Copy link
Member

gfyoung commented Apr 4, 2016

  1. SparseArray inherits from np.ndarray, but it doesn't seem like the instance itself can take on more than one dimension? Documentation doesn't make that super clear IMO.

  2. If having 1-D sparse arrays is the intention, then I think there should be stronger checks against multi-dimensional data inputs. For example, if I pass in a multi-dimensional ndarray into SparseArray, I get a not so helpful error message that it does not have an sp_index.

@gfyoung gfyoung changed the title SparseArray Interface and Documentation is Confusing API, DOC: SparseArray Interface and Documentation is Confusing Apr 4, 2016
@jreback
Copy link
Contributor

jreback commented Apr 4, 2016

SparseArray is an implementation detail. Its not user facing.

@jreback jreback added the Sparse Sparse Data Type label Apr 4, 2016
@gfyoung
Copy link
Member Author

gfyoung commented Apr 4, 2016

What do you mean by not "user-facing"?

@jreback
Copy link
Contributor

jreback commented Apr 4, 2016

exactly what I mean. Its a detail that is hidden away from the user. Its the .values of the SparseSeries. In theory it could be swapped for another implementation (e.g. from scipy or whatever). Its not needed by the user and is a sub-class of a numpy-array. So if anything you can simply update the docs to reflect this.

@jreback jreback added the Docs label Apr 4, 2016
@kawochen
Copy link
Contributor

kawochen commented Apr 4, 2016

Doc already says 1D though.

@gfyoung
Copy link
Member Author

gfyoung commented Apr 4, 2016

I couldn't find anything that explicitly says that in array.py AFAICT

@jreback
Copy link
Contributor

jreback commented Apr 4, 2016

@gfyoung you can certainly document it more if you want.

@jreback jreback added this to the Next Major Release milestone Apr 4, 2016
@kawochen kawochen mentioned this issue Apr 4, 2016
18 tasks
@gfyoung
Copy link
Member Author

gfyoung commented Apr 4, 2016

@jreback : Sure thing. It was just another thing I noticed as I have been squashing fromnumeric.py compat issues (same with the Categorical issue).

@kawochen
Copy link
Contributor

kawochen commented Apr 4, 2016

@gfyoung
Copy link
Member Author

gfyoung commented Apr 4, 2016

@kawochen : Fair enough, but I think the documentation internally should nevertheless reflect that as well. Perhaps it may not be for user eyes, but for developer eyes, more info is better.

@kawochen
Copy link
Contributor

kawochen commented Apr 4, 2016

I agree.

@gfyoung
Copy link
Member Author

gfyoung commented Apr 6, 2016

@jreback : Made the doc changes in my massive PR #12810 as I was addressing incompatibilities in pandas.sparse, so I think this issue can allotted to v0.18.1.

@jreback jreback modified the milestones: 0.18.1, Next Major Release Apr 6, 2016
@jreback
Copy link
Contributor

jreback commented Apr 27, 2016

@gfyoung can you split this one off.

@gfyoung
Copy link
Member Author

gfyoung commented Apr 27, 2016

@jreback : My computer has been acting a little weird recently, which is why I have been somewhat inactive (answering on phone ATM). I'll get to this ASAP once I get my computer checked out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Sparse Sparse Data Type
Projects
None yet
Development

No branches or pull requests

3 participants