Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ENH: Use int shape #2995

Merged
merged 2 commits into from

4 participants

@Eric89GXL

This suppresses numpy warnings.

@pv
Owner
pv commented

Maybe better use newshape = [1]*x.ndim

In [2]: %timeit np.ones(5, dtype=int)
1000000 loops, best of 3: 1.75 us per loop
In [3]: %timeit [1]*5
10000000 loops, best of 3: 152 ns per loop

Not that it matters a lot, but it's weird to use an array for the shape tuple.

@Eric89GXL

Fine by me @pv... might as well speed up while fixing a minor bug. Latest commit adds this.

@coveralls

Coverage Status

Coverage remained the same when pulling 1f449dd on Eric89GXL:signaltools-int-fix into 7479249 on scipy:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 1f449dd on Eric89GXL:signaltools-int-fix into 7479249 on scipy:master.

@rgommers rgommers merged commit 7dd9e12 into scipy:master
@rgommers
Owner

Thanks @Eric89GXL, merged.

@Eric89GXL Eric89GXL deleted the Eric89GXL:signaltools-int-fix branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2013
  1. @Eric89GXL

    ENH: Use int shape

    Eric89GXL authored
  2. @Eric89GXL

    ENH: Faster shaping

    Eric89GXL authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  scipy/signal/signaltools.py
View
2  scipy/signal/signaltools.py
@@ -1323,7 +1323,7 @@ def resample(x, num, t=None, axis=0, window=None):
W = window
else:
W = ifftshift(get_window(window, Nx))
- newshape = ones(len(x.shape))
+ newshape = [1] * x.ndim
newshape[axis] = len(W)
W.shape = newshape
X = X * W
Something went wrong with that request. Please try again.