Repository: scipy/scipy

Issue:
BUG: `signal.get_window` argument handling issue 
<!-- 
Thank you for taking the time to file a bug report. 
Please fill in the fields below, deleting the sections that 
don't apply to your issue. You can view the final output
by clicking the preview button above.
Note: This is a comment, and won't appear in the output.
-->

My issue is about ...
[signal\.windows\.taylor](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.windows.taylor.html#scipy.signal.windows.taylor) needs only one argument `M`, others are optional.
So, this code works:
```
>>> signal.windows.taylor(7)
array([0.29009531, 0.5782126 , 0.87800822, 1.        , 0.87800822,
       0.5782126 , 0.29009531])
```

However, same thing using [signal\.windows\.get\_window](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.windows.get_window.html#scipy.signal.windows.get_window) does not work:
```
>>> signal.get_window("taylor",7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scipy/signal/windows/windows.py", line 2153, in get_window
    return winfunc(*params)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/scipy/signal/windows/windows.py", line 1714, in taylor
    Fm = np.empty(nbar-1)
ValueError: negative dimensions are not allowed
```
I think it should work.

#### Scipy/Numpy/Python version information:
<!-- You can simply run the following and paste the result in a code block
```
import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
```
-->
Scipy: 1.6.2


Discussion:

Resolving patch:
diff --git a/scipy/signal/windows/windows.py b/scipy/signal/windows/windows.py
--- a/scipy/signal/windows/windows.py
+++ b/scipy/signal/windows/windows.py
@@ -2147,11 +2147,11 @@ def get_window(window, Nx, fftbins=True):
             raise ValueError("Unknown window type.") from e
 
         if winfunc is dpss:
-            params = (Nx,) + args + (None, sym)
+            params = (Nx,) + args + (None,)
         else:
-            params = (Nx,) + args + (sym,)
+            params = (Nx,) + args
     else:
         winfunc = kaiser
-        params = (Nx, beta, sym)
+        params = (Nx, beta)
 
-    return winfunc(*params)
+    return winfunc(*params, sym=sym)


Test patch:
diff --git a/scipy/signal/tests/test_windows.py b/scipy/signal/tests/test_windows.py
--- a/scipy/signal/tests/test_windows.py
+++ b/scipy/signal/tests/test_windows.py
@@ -707,6 +707,25 @@ def test_needs_params():
         assert_raises(ValueError, get_window, winstr, 7)
 
 
+def test_not_needs_params():
+    for winstr in ['barthann',
+                   'bartlett',
+                   'blackman',
+                   'blackmanharris',
+                   'bohman',
+                   'boxcar',
+                   'cosine',
+                   'flattop',
+                   'hamming',
+                   'hanning',
+                   'nuttall',
+                   'parzen',
+                   'taylor',
+                   'triangle']:
+        win = get_window(winstr, 7)
+        assert_equal(len(win), 7)
+
+
 def test_deprecation():
     if dep_hann.__doc__ is not None:  # can be None with `-OO` mode
         assert_('signal.hann is deprecated' in dep_hann.__doc__)