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

take and split method in sparse.dok_matrix do not work because of the local variable not being initialized correctly #2645

Closed
lubobill1990 opened this issue Jul 22, 2013 · 2 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse

Comments

@lubobill1990
Copy link

The first code line in take and split method of sparse.doc_matrix is written as:

new = dok_matrix(dtype=self.dtype)    # what should the dimensions be ?!

However, the doc_matrix should be initialized with the size of it, so it will raise the error as:

TypeError: __init__() takes at least 2 arguments (2 given)
@rgommers
Copy link
Member

Indeed, clear bug. Test coverage is quite poor. take should probably be removed, getrow and getcol can be implemented instead, like in other spmatrix subclasses. Not sure about split, maybe should be removed as well?

pv added a commit that referenced this issue Aug 21, 2013
BUG: sparse: DOK and LIL improvements

* Raise a warning when you try to create a sparse matrix with
  dtype=object, and add a note to the docs stating that SciPy Sparse is for
  numeric data.
* Remove the broken and undocumented take and split methods from DOK, add getrow and getcol.
* Fix the casting for scalar multiplication with LIL and DOK and turn on tests for them.

Fixes gh-2528, gh-2645, and gh-2542.
@pv
Copy link
Member

pv commented Aug 21, 2013

Removed in 6619f15

@pv pv closed this as completed Aug 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse
Projects
None yet
Development

No branches or pull requests

3 participants