Repository: pandas-dev/pandas
Pull request: DOC: Fix summaries not ending with a period
I have fixed all 'Summary does not end with a period' issue except these two:
![image](https://user-images.githubusercontent.com/25010571/49705373-ed2f8180-fbeb-11e8-9f7c-5cf8d2b3aa81.png)
I couldn't find the linenumbers in the corresponding file, and also couldn't fix it by looking for 'argmin' or 'argmax' in Panda directory. Please advise if there is anything else I could try.

- [x] closes #24164
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Problem statement:
DOC: Fix docstrings error SS03 - Summary does not end with a period
when checking for errors with ./scripts/validate_docstrings.py --errors=SS03 --format=azure --prefix=pandas.Series. We get all SS03 errors in pandas/core/generic.py file. 

I will be working on this and create a pull request afterwards. Thanks.

Hints from issue discussion:
Not only in generic.py, some other files too, I will be fixing them all together.

Commit message: Update pandas/core/arrays/datetimes.py

Co-Authored-By: YuechengWu <ywu194@myseneca.ca>

Patch to review:
diff --git a/pandas/core/accessor.py b/pandas/core/accessor.py
index fa1dc751c17da..93b4ce31a1e25 100644
--- a/pandas/core/accessor.py
+++ b/pandas/core/accessor.py
@@ -59,7 +59,7 @@ def _delegate_method(self, name, *args, **kwargs):
     def _add_delegate_accessors(cls, delegate, accessors, typ,
                                 overwrite=False):
         """
-        add accessors to cls from the delegate class
+        Add accessors to cls from the delegate class.
 
         Parameters
         ----------
diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py
index 6e96fc75daec9..b2c580ac435db 100644
--- a/pandas/core/arrays/categorical.py
+++ b/pandas/core/arrays/categorical.py
@@ -477,7 +477,7 @@ def categories(self, categories):
     @property
     def ordered(self):
         """
-        Whether the categories have an ordered relationship
+        Whether the categories have an ordered relationship.
         """
         return self.dtype.ordered
 
@@ -782,7 +782,7 @@ def set_ordered(self, value, inplace=False):
 
     def as_ordered(self, inplace=False):
         """
-        Sets the Categorical to be ordered
+        Set the Categorical to be ordered.
 
         Parameters
         ----------
@@ -795,7 +795,7 @@ def as_ordered(self, inplace=False):
 
     def as_unordered(self, inplace=False):
         """
-        Sets the Categorical to be unordered
+        Set the Categorical to be unordered.
 
         Parameters
         ----------
diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py
index b74ede4547249..ab848bad93cc6 100644
--- a/pandas/core/arrays/datetimes.py
+++ b/pandas/core/arrays/datetimes.py
@@ -82,7 +82,7 @@ def f(self):
         return result
 
     f.__name__ = name
-    f.__doc__ = "\n{}\n".format(docstring)
+    f.__doc__ = "{}".format(docstring)
     return property(f)
 
 
@@ -1065,19 +1065,19 @@ def date(self):
 
         return tslib.ints_to_pydatetime(timestamps, box="date")
 
-    year = _field_accessor('year', 'Y', "\n The year of the datetime\n")
+    year = _field_accessor('year', 'Y', "The year of the datetime.")
     month = _field_accessor('month', 'M',
-                            "\n The month as January=1, December=12 \n")
-    day = _field_accessor('day', 'D', "\nThe days of the datetime\n")
-    hour = _field_accessor('hour', 'h', "\nThe hours of the datetime\n")
-    minute = _field_accessor('minute', 'm', "\nThe minutes of the datetime\n")
-    second = _field_accessor('second', 's', "\nThe seconds of the datetime\n")
+                            "The month as January=1, December=12. ")
+    day = _field_accessor('day', 'D', "The days of the datetime.")
+    hour = _field_accessor('hour', 'h', "The hours of the datetime.")
+    minute = _field_accessor('minute', 'm', "The minutes of the datetime.")
+    second = _field_accessor('second', 's', "The seconds of the datetime.")
     microsecond = _field_accessor('microsecond', 'us',
-                                  "\nThe microseconds of the datetime\n")
+                                  "The microseconds of the datetime.")
     nanosecond = _field_accessor('nanosecond', 'ns',
-                                 "\nThe nanoseconds of the datetime\n")
+                                 "The nanoseconds of the datetime.")
     weekofyear = _field_accessor('weekofyear', 'woy',
-                                 "\nThe week ordinal of the year\n")
+                                 "The week ordinal of the year.")
     week = weekofyear
     _dayofweek_doc = """
     The day of the week with Monday=0, Sunday=6.
diff --git a/pandas/core/base.py b/pandas/core/base.py
index 1d2a0a2544dbc..161bf8fbf3482 100644
--- a/pandas/core/base.py
+++ b/pandas/core/base.py
@@ -1244,7 +1244,7 @@ def nunique(self, dropna=True):
     @property
     def is_unique(self):
         """
-        Return boolean if values in the object are unique
+        Return boolean if values in the object are unique.
 
         Returns
         -------
@@ -1256,7 +1256,7 @@ def is_unique(self):
     def is_monotonic(self):
         """
         Return boolean if values in the object are
-        monotonic_increasing
+        monotonic_increasing.
 
         .. versionadded:: 0.19.0
 
@@ -1273,7 +1273,7 @@ def is_monotonic(self):
     def is_monotonic_decreasing(self):
         """
         Return boolean if values in the object are
-        monotonic_decreasing
+        monotonic_decreasing.
 
         .. versionadded:: 0.19.0
 
diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py
index 0db76cd934d19..24407850d44a8 100644
--- a/pandas/core/dtypes/dtypes.py
+++ b/pandas/core/dtypes/dtypes.py
@@ -463,7 +463,7 @@ def categories(self):
     @property
     def ordered(self):
         """
-        Whether the categories have an ordered relationship
+        Whether the categories have an ordered relationship.
         """
         return self._ordered
 
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 1e26c3f45f660..e52a0b60c610e 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -671,7 +671,7 @@ def transpose(self, *args, **kwargs):
 
     def swapaxes(self, axis1, axis2, copy=True):
         """
-        Interchange axes and swap values axes appropriately
+        Interchange axes and swap values axes appropriately.
 
         Returns
         -------
@@ -1907,7 +1907,7 @@ def __array_wrap__(self, result, context=None):
 
     def to_dense(self):
         """
-        Return dense representation of NDFrame (as opposed to sparse)
+        Return dense representation of NDFrame (as opposed to sparse).
         """
         # compat
         return self
@@ -3597,7 +3597,7 @@ class   animal   locomotion
 
     def select(self, crit, axis=0):
         """
-        Return data corresponding to axis labels matching criteria
+        Return data corresponding to axis labels matching criteria.
 
         .. deprecated:: 0.21.0
             Use df.loc[df.index.map(crit)] to select via labels
@@ -4841,7 +4841,7 @@ def sample(self, n=None, frac=None, replace=False, weights=None,
         return self.take(locs, axis=axis, is_copy=False)
 
     _shared_docs['pipe'] = (r"""
-        Apply func(self, \*args, \*\*kwargs)
+        Apply func(self, \*args, \*\*kwargs).
 
         Parameters
         ----------
@@ -5533,7 +5533,7 @@ def as_blocks(self, copy=True):
     @property
     def blocks(self):
         """
-        Internal property, property synonym for as_blocks()
+        Internal property, property synonym for as_blocks().
 
         .. deprecated:: 0.21.0
         """
@@ -5918,7 +5918,7 @@ def infer_objects(self):
     def fillna(self, value=None, method=None, axis=None, inplace=False,
                limit=None, downcast=None):
         """
-        Fill NA/NaN values using the specified method
+        Fill NA/NaN values using the specified method.
 
         Parameters
         ----------
@@ -6103,14 +6103,16 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
 
     def ffill(self, axis=None, inplace=False, limit=None, downcast=None):
         """
-        Synonym for :meth:`DataFrame.fillna(method='ffill') <DataFrame.fillna>`
+        Synonym for :meth:`DataFrame.fillna(method='ffill')
+            <DataFrame.fillna>`.
         """
         return self.fillna(method='ffill', axis=axis, inplace=inplace,
                            limit=limit, downcast=downcast)
 
     def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
         """
-        Synonym for :meth:`DataFrame.fillna(method='bfill') <DataFrame.fillna>`
+        Synonym for :meth:`DataFrame.fillna(method='bfill')
+            <DataFrame.fillna>`.
         """
         return self.fillna(method='bfill', axis=axis, inplace=inplace,
                            limit=limit, downcast=downcast)
@@ -8251,7 +8253,7 @@ def rank(self, axis=0, method='average', numeric_only=None,
              na_option='keep', ascending=True, pct=False):
         """
         Compute numerical data ranks (1 through n) along axis. Equal values are
-        assigned a rank that is the average of the ranks of those values
+        assigned a rank that is the average of the ranks of those values.
 
         Parameters
         ----------
@@ -8313,7 +8315,7 @@ def ranker(data):
 
     _shared_docs['align'] = ("""
         Align two objects on their axes with the
-        specified join method for each axis Index
+        specified join method for each axis Index.
 
         Parameters
         ----------
@@ -9902,7 +9904,7 @@ def _add_numeric_operations(cls):
 
         @Substitution(outname='mad',
                       desc="Return the mean absolute deviation of the values "
-                           "for the requested axis",
+                           "for the requested axis.",
                       name1=name, name2=name2, axis_descr=axis_descr,
                       min_count='', examples='')
         @Appender(_num_doc)
@@ -9944,7 +9946,7 @@ def mad(self, axis=None, skipna=None, level=None):
 
         @Substitution(outname='compounded',
                       desc="Return the compound percentage of the values for "
-                      "the requested axis", name1=name, name2=name2,
+                      "the requested axis.", name1=name, name2=name2,
                       axis_descr=axis_descr,
                       min_count='', examples='')
         @Appender(_num_doc)
@@ -9974,31 +9976,31 @@ def compound(self, axis=None, skipna=None, level=None):
 
         cls.sum = _make_min_count_stat_function(
             cls, 'sum', name, name2, axis_descr,
-            'Return the sum of the values for the requested axis',
+            'Return the sum of the values for the requested axis.',
             nanops.nansum, _sum_examples)
         cls.mean = _make_stat_function(
             cls, 'mean', name, name2, axis_descr,
-            'Return the mean of the values for the requested axis',
+            'Return the mean of the values for the requested axis.',
             nanops.nanmean)
         cls.skew = _make_stat_function(
             cls, 'skew', name, name2, axis_descr,
-            'Return unbiased skew over requested axis\nNormalized by N-1',
+            'Return unbiased skew over requested axis\nNormalized by N-1.',
             nanops.nanskew)
         cls.kurt = _make_stat_function(
             cls, 'kurt', name, name2, axis_descr,
             "Return unbiased kurtosis over requested axis using Fisher's "
             "definition of\nkurtosis (kurtosis of normal == 0.0). Normalized "
-            "by N-1",
+            "by N-1.",
             nanops.nankurt)
         cls.kurtosis = cls.kurt
         cls.prod = _make_min_count_stat_function(
             cls, 'prod', name, name2, axis_descr,
-            'Return the product of the values for the requested axis',
+            'Return the product of the values for the requested axis.',
             nanops.nanprod, _prod_examples)
         cls.product = cls.prod
         cls.median = _make_stat_function(
             cls, 'median', name, name2, axis_descr,
-            'Return the median of the values for the requested axis',
+            'Return the median of the values for the requested axis.',
             nanops.nanmedian)
         cls.max = _make_stat_function(
             cls, 'max', name, name2, axis_descr,
diff --git a/pandas/core/indexes/accessors.py b/pandas/core/indexes/accessors.py
index 82b6b22be4a79..ecc96ca1ecc94 100644
--- a/pandas/core/indexes/accessors.py
+++ b/pandas/core/indexes/accessors.py
@@ -130,7 +130,7 @@ class DatetimeProperties(Properties):
 
     def to_pydatetime(self):
         """
-        Return the data as an array of native Python datetime objects
+        Return the data as an array of native Python datetime objects.
 
         Timezone information is retained if present.
 
diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py
index ec6743e205848..52d40f84cb1d9 100644
--- a/pandas/plotting/_core.py
+++ b/pandas/plotting/_core.py
@@ -2417,7 +2417,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
                 xrot=None, ylabelsize=None, yrot=None, figsize=None,
                 bins=10, **kwds):
     """
-    Draw histogram of the input series using matplotlib
+    Draw histogram of the input series using matplotlib.
 
     Parameters
     ----------
@@ -2706,7 +2706,7 @@ def __call__(self, *args, **kwargs):
 
 class SeriesPlotMethods(BasePlotMethods):
     """
-    Series plotting accessor and method
+    Series plotting accessor and method.
 
     Examples
     --------
@@ -2739,7 +2739,7 @@ def __call__(self, kind='line', ax=None,
 
     def line(self, **kwds):
         """
-        Line plot
+        Line plot.
 
         Parameters
         ----------
@@ -2764,7 +2764,7 @@ def line(self, **kwds):
 
     def bar(self, **kwds):
         """
-        Vertical bar plot
+        Vertical bar plot.
 
         Parameters
         ----------
@@ -2780,7 +2780,7 @@ def bar(self, **kwds):
 
     def barh(self, **kwds):
         """
-        Horizontal bar plot
+        Horizontal bar plot.
 
         Parameters
         ----------
@@ -2796,7 +2796,7 @@ def barh(self, **kwds):
 
     def box(self, **kwds):
         """
-        Boxplot
+        Boxplot.
 
         Parameters
         ----------
@@ -2812,7 +2812,7 @@ def box(self, **kwds):
 
     def hist(self, bins=10, **kwds):
         """
-        Histogram
+        Histogram.
 
         Parameters
         ----------
@@ -2873,7 +2873,7 @@ def kde(self, bw_method=None, ind=None, **kwds):
 
     def area(self, **kwds):
         """
-        Area plot
+        Area plot.
 
         Parameters
         ----------
@@ -2889,7 +2889,7 @@ def area(self, **kwds):
 
     def pie(self, **kwds):
         """
-        Pie chart
+        Pie chart.
 
         Parameters
         ----------


Code review comments:
diff_hunk: @@ -82,7 +82,7 @@ def f(self):
         return result
 
     f.__name__ = name
-    f.__doc__ = "\n{}\n".format(docstring)
+    f.__doc__ = "{}".format(docstring)
path: pandas/core/arrays/datetimes.py
text: @user1:
What is this change for?

@author:
I will revert these as we discussed. Thanks.

@author:
@user1 For some reason I am not able to push my commits. I don't know why. Here is the error message.
![image](https://user-images.githubusercontent.com/25010571/49783198-08cb8280-fce7-11e8-8ed9-defb648e71a8.png)



@user1:
Assuming origin is your own repo and you are working from a different computer than before you are behind your repo locally. Quite a few ways to solve; depending on how much work you just did easiest may be to reset to the prior commit, pull from master than redo your change on top. Rebasing is another option

@author:
I tried reset to the prior commit, but still unable to push. Then I tried rebasing, same error still persists. Not too sure what to do at this point.

@user2:
```
f.__doc__ = docstring
```
but before, can you run the validation script for one of the functions generated with this, and paste the output in a comment?

I think this was required to avoid the error of having the opening quotes in the same line as the summary. Is this change required for the validation, or ut was just to clean up like in the other cases where `\n` is removed?