From 2a5dbad4728ae9d42bbb0554d407495375785041 Mon Sep 17 00:00:00 2001 From: e-q Date: Thu, 9 Apr 2015 17:54:15 -0700 Subject: [PATCH] Remove singleton dimension in a python2.6 compatible way --- scipy/signal/spectral.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipy/signal/spectral.py b/scipy/signal/spectral.py index 23023109ba75..9d279a832815 100644 --- a/scipy/signal/spectral.py +++ b/scipy/signal/spectral.py @@ -368,7 +368,7 @@ def csd(x, y, fs=1.0, window='hanning', nperseg=256, noverlap=None, nfft=None, if Pxy.shape[-1] > 1: Pxy = Pxy.mean(axis=-1) else: - Pxy = np.squeeze(Pxy, axis=-1) + Pxy = np.reshape(Pxy, Pxy.shape[:-1]) return freqs, Pxy