Repository: pandas-dev/pandas
Pull request: DOC: explain EWM 
- [ ] closes #34867
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Problem statement:
DOC: pandas/pandas/core/window/ewm.py
#### Location of the documentation
Docstring for `class EWM(_Rolling)` in ewm.py.

#### Documentation problem
The purposes of the `EWM` class is unclear because there's no documentation on what 'ewm' is abbreviating. One reason this is confusing is that `ewm` can easily be interpreted as either "exponentially weighted mean" or "exponentially weighted moving". The `EWM` class docstring actually muddies the water further by stating that the class provides "exponential weighted **(EW)** functions".

#### Suggested fix for documentation
If it's absolutely necessary to use an abbreviation like `ewm` then the docstring needs to clearly state what it's abbreviating.

Hints from issue discussion:
Thanks @db-baron for the report - are you interested in [submitting a pull request](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html)?
take
closing in favor of #34910 
ehh? this is the issue, not PR? @jreback 
Reopening as I'm pretty sure Jeff meant to close #34901 instead :)

Commit message: fixed pep8 issue

Patch to review:
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 701909c9df857..1404d225eea97 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -10460,7 +10460,12 @@ def _add_series_or_dataframe_operations(cls):
         Add the series or dataframe only operations to the cls; evaluate
         the doc strings again.
         """
-        from pandas.core.window import EWM, Expanding, Rolling, Window
+        from pandas.core.window import (
+            Expanding,
+            ExponentialMovingWindow,
+            Rolling,
+            Window,
+        )
 
         @doc(Rolling)
         def rolling(
@@ -10507,7 +10512,7 @@ def expanding(self, min_periods=1, center=False, axis=0):
 
         cls.expanding = expanding
 
-        @doc(EWM)
+        @doc(ExponentialMovingWindow)
         def ewm(
             self,
             com=None,
@@ -10520,7 +10525,7 @@ def ewm(
             axis=0,
         ):
             axis = self._get_axis_number(axis)
-            return EWM(
+            return ExponentialMovingWindow(
                 self,
                 com=com,
                 span=span,
diff --git a/pandas/core/window/__init__.py b/pandas/core/window/__init__.py
index dcf58a4c0dd5b..68773b3fcc651 100644
--- a/pandas/core/window/__init__.py
+++ b/pandas/core/window/__init__.py
@@ -1,3 +1,3 @@
-from pandas.core.window.ewm import EWM  # noqa:F401
+from pandas.core.window.exponentialmoving import ExponentialMovingWindow  # noqa:F401
 from pandas.core.window.expanding import Expanding, ExpandingGroupby  # noqa:F401
 from pandas.core.window.rolling import Rolling, RollingGroupby, Window  # noqa:F401
diff --git a/pandas/core/window/ewm.py b/pandas/core/window/exponentialmoving.py
similarity index 99%
rename from pandas/core/window/ewm.py
rename to pandas/core/window/exponentialmoving.py
index b708020be90d2..ee80f80b320e4 100644
--- a/pandas/core/window/ewm.py
+++ b/pandas/core/window/exponentialmoving.py
@@ -59,7 +59,7 @@ def get_center_of_mass(
     return float(comass)
 
 
-class EWM(_Rolling):
+class ExponentialMovingWindow(_Rolling):
     r"""
     Provide exponential weighted (EW) functions.
 
@@ -185,7 +185,7 @@ def __init__(
 
     @property
     def _constructor(self):
-        return EWM
+        return ExponentialMovingWindow
 
     _agg_see_also_doc = dedent(
         """
diff --git a/pandas/tests/window/test_ewm.py b/pandas/tests/window/test_ewm.py
index 9ba194dcf0959..0957cac7aff95 100644
--- a/pandas/tests/window/test_ewm.py
+++ b/pandas/tests/window/test_ewm.py
@@ -4,7 +4,7 @@
 from pandas.errors import UnsupportedFunctionCall
 
 from pandas import DataFrame, Series
-from pandas.core.window import EWM
+from pandas.core.window import ExponentialMovingWindow
 
 
 def test_doc_string():
@@ -56,7 +56,7 @@ def test_constructor(which):
 @pytest.mark.parametrize("method", ["std", "mean", "var"])
 def test_numpy_compat(method):
     # see gh-12811
-    e = EWM(Series([2, 4, 6]), alpha=0.5)
+    e = ExponentialMovingWindow(Series([2, 4, 6]), alpha=0.5)
 
     msg = "numpy operations are not valid with window objects"
 


Code review comments:
diff_hunk: @@ -1,3 +1,3 @@
-from pandas.core.window.ewm import EWM  # noqa:F401
+from pandas.core.window.exponentialmoving import ExponentialMovingWindow  # noqa:F401
path: pandas/core/window/__init__.py
text: @user1:
need `isort` to sort imports, aka, this needs to be placed under `from pandas.core.window.expanding import Expanding, ExpandingGroupby  # noqa:F401`
so looks something like below overall:
```python
from pandas.core.window.expanding import Expanding, ExpandingGroupby  # noqa:F401
from pandas.core.window.exponentialmoving import ExponentialMovingWindow  # noqa:F401
from pandas.core.window.rolling import Rolling, RollingGroupby, Window  # noqa:F401
```

@author:
alright will get that sorted

@author:
it's weird that the first issue 'pandas.core.window.ewm not found error' occured because in theory when I refactored the file name all the usages were renamed in pycharm. anyway changed the name back so it should be fine.

@author:
anyways I'll leave these checks to run and check in on them in the morning they take ages.