Skip to content

Commit c737435

Browse files
committed
ENH: Avoid Nx0 arrays
1 parent 88b42a1 commit c737435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nipype/algorithms/confounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def cosine_filter(data, timestep, period_cut, remove_mean=False, axis=-1):
846846

847847
frametimes = timestep * np.arange(timepoints)
848848
X = _full_rank(_cosine_drift(period_cut, frametimes))[0]
849-
non_constant_regressors = X[:, :-1]
849+
non_constant_regressors = X[:, :-1] if X.shape[1] > 1 else np.array([])
850850

851851
betas = np.linalg.lstsq(X, data.T)[0]
852852

0 commit comments

Comments
 (0)