Repository: pandas-dev/pandas

Issue:
Rolling.apply documentation not clear
The current documentation for [rolling.apply](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.window.Rolling.apply.html) states:

> func : function
> Must produce a single value from an ndarray input if raw=True or a Series if raw=False.

This makes it sound like a series consisting of multiple values can be returned by the apply func.  This is not true.  The following error results:

Pandas v 0.24.1
```python
samples = roll.apply(lambda x: pd.Series([1]), raw=True)
example = pd.Series(np.random.rand(10000,))
example.rolling(100).apply(lambda x: pd.Series([1,2,3,4]), raw=False)

~/anaconda3/envs/pandas/core/series.py in wrapper(self)
     91             return converter(self.iloc[0])
     92         raise TypeError("cannot convert the series to "
---> 93                         "{0}".format(str(converter)))
     94 
     95     wrapper.__name__ = "__{name}__".format(name=converter.__name__)
TypeError: cannot convert the series to <class 'float'>
```
Rolling.apply documentation not clear
The current documentation for [rolling.apply](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.window.Rolling.apply.html) states:

> func : function
> Must produce a single value from an ndarray input if raw=True or a Series if raw=False.

This makes it sound like a series consisting of multiple values can be returned by the apply func.  This is not true.  The following error results:

Pandas v 0.24.1
```python
samples = roll.apply(lambda x: pd.Series([1]), raw=True)
example = pd.Series(np.random.rand(10000,))
example.rolling(100).apply(lambda x: pd.Series([1,2,3,4]), raw=False)

~/anaconda3/envs/pandas/core/series.py in wrapper(self)
     91             return converter(self.iloc[0])
     92         raise TypeError("cannot convert the series to "
---> 93                         "{0}".format(str(converter)))
     94 
     95     wrapper.__name__ = "__{name}__".format(name=converter.__name__)
TypeError: cannot convert the series to <class 'float'>
```


Discussion:
The `func` argument is documented as follows:

```
Must produce a single value from an ndarray input if raw=True or a Series if raw=False.
```

So the problem is that your expression doesn't reduce to a scalar. 

What distinction are you trying to make with Series here? This will fail if you replace with a NumPy array as well (though admittedly with a different error message)
The `func` argument is documented as follows:

```
Must produce a single value from an ndarray input if raw=True or a Series if raw=False.
```

So the problem is that your expression doesn't reduce to a scalar. 

What distinction are you trying to make with Series here? This will fail if you replace with a NumPy array as well (though admittedly with a different error message)

Resolving patch:
diff --git a/pandas/core/window.py b/pandas/core/window.py
--- a/pandas/core/window.py
+++ b/pandas/core/window.py
@@ -953,7 +953,7 @@ def count(self):
     ----------
     func : function
         Must produce a single value from an ndarray input if ``raw=True``
-        or a Series if ``raw=False``.
+        or a single value from a Series if ``raw=False``.
     raw : bool, default None
         * ``False`` : passes each row or column as a Series to the
           function.


Test patch: