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 abadd64b441b4..101d03cd55d40 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 72ab400b41c0c..4849ee1e3e665 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1070,19 +1070,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 ba50b971b6ff9..11d1333851794 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') ` + Synonym for :meth:`DataFrame.fillna(method='ffill') + `. """ 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') ` + Synonym for :meth:`DataFrame.fillna(method='bfill') + `. """ return self.fillna(method='bfill', axis=axis, inplace=inplace, limit=limit, downcast=downcast) @@ -8254,7 +8256,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 ---------- @@ -8316,7 +8318,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 ---------- @@ -9905,7 +9907,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) @@ -9947,7 +9949,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) @@ -9977,31 +9979,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 ----------