Skip to content

Commit 2b42b43

Browse files
committed
FIX: Replace np.product with np.prod
1 parent 4411b30 commit 2b42b43

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

nitime/algorithms/spectral.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def multi_taper_psd(
523523
"""
524524
# have last axis be time series for now
525525
N = s.shape[-1]
526-
M = int(np.product(s.shape[:-1]))
526+
M = int(np.prod(s.shape[:-1]))
527527

528528
if BW is not None:
529529
# BW wins in a contest (since it was the original implementation)
@@ -663,7 +663,7 @@ def multi_taper_csd(s, Fs=2 * np.pi, NW=None, BW=None, low_bias=True,
663663
"""
664664
# have last axis be time series for now
665665
N = s.shape[-1]
666-
M = int(np.product(s.shape[:-1]))
666+
M = int(np.prod(s.shape[:-1]))
667667

668668
if BW is not None:
669669
# BW wins in a contest (since it was the original implementation)

nitime/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,8 @@ def tapered_spectra(s, tapers, NFFT=None, low_bias=True):
730730
if NFFT is None or NFFT < N:
731731
NFFT = N
732732
rest_of_dims = s.shape[:-1]
733-
M = int(np.product(rest_of_dims))
734733

735-
s = s.reshape(int(np.product(rest_of_dims)), N)
734+
s = s.reshape(-1, N)
736735
# de-mean this sucker
737736
s = remove_bias(s, axis=-1)
738737

@@ -1193,7 +1192,7 @@ def fftconvolve(in1, in2, mode="full", axis=None):
11931192
if mode == "full":
11941193
return ret
11951194
elif mode == "same":
1196-
if np.product(s1, axis=0) > np.product(s2, axis=0):
1195+
if np.prod(s1, axis=0) > np.prod(s2, axis=0):
11971196
osize = s1
11981197
else:
11991198
osize = s2

0 commit comments

Comments
 (0)