Skip to content

Commit

Permalink
BUG: sparse/lil: fix object array assignment issue in Numpy 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Feb 25, 2014
1 parent 37741c4 commit 56365d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scipy/sparse/lil.py
Expand Up @@ -326,16 +326,16 @@ def _mul_scalar(self, other):
new = self.copy()
new = new.astype(res_dtype)
# Multiply this scalar by every element.
new.data[:] = [[val*other for val in rowvals] for
rowvals in new.data]
for j, rowvals in enumerate(new.data):
new.data[j] = [val*other for val in rowvals]
return new

def __truediv__(self, other): # self / other
if isscalarlike(other):
new = self.copy()
# Divide every element by this scalar
new.data[:] = [[val/other for val in rowvals] for
rowvals in new.data]
for j, rowvals in enumerate(new.data):
new.data[j] = [val/other for val in rowvals]
return new
else:
return self.tocsr() / other
Expand Down

0 comments on commit 56365d0

Please sign in to comment.