Skip to content

Commit

Permalink
ENH larry.take() is now faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwgoodman committed Mar 27, 2012
1 parent cd7e39d commit 3ebccae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions RELEASE.rst
Expand Up @@ -16,11 +16,10 @@ la 0.7
- Indexing into larrys with scalars, slices, and 1d numpy arrays
- Binary functions (+, -, / , &, ...) for unaligned larrys
- la.align(), la.add(), la.subtract(), etc for unaligned larrys
- la.union(), la.intersection()
- la.align_axis()
- la.union(), la.intersection(), la.align_axis()
- la.farray.correlation(arr1, arr2, axis) for numpy arrays
- larry.morph(), larry.morph_like()
- larry.merge() when update=True
- larry.merge() when update=True, larry.morph(), larry.morph_like()
- larry.take()

**Breakage from la 0.6**

Expand Down
7 changes: 5 additions & 2 deletions la/deflarry.py
Expand Up @@ -1799,9 +1799,12 @@ def take(self, indices, axis):
"""
label = self.copylabel()
labelaxis = label[axis]
label[axis] = [labelaxis[idx] for idx in indices]
lab = [labelaxis[idx] for idx in indices]
if len(set(lab)) != len(lab):
raise IndexError("`indices` must be unique")
label[axis] = lab
x = self.x.take(indices, axis)
return larry(x, label)
return larry(x, label, validate=False)

@property
def lix(self):
Expand Down

0 comments on commit 3ebccae

Please sign in to comment.