diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index 328b67b6722f1..a14efd3313eaf 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -125,7 +125,7 @@ def is_scalar(val: object) -> bool: - Interval - DateOffset - Fraction - - Number + - Number. Returns ------- @@ -867,9 +867,10 @@ def is_list_like(obj: object, allow_sets: bool = True): Parameters ---------- - obj : The object to check - allow_sets : boolean, default True - If this parameter is False, sets will not be considered list-like + obj : object + The object to check. + allow_sets : bool, default True + If this parameter is False, sets will not be considered list-like. .. versionadded:: 0.24.0 diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index 4039cc91fb554..869019cd3d222 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -260,9 +260,9 @@ def _from_factorized(cls, values, original): Whether the intervals are closed on the left-side, right-side, both or neither. copy : bool, default False - copy the data + Copy the data. dtype : dtype or None, default None - If None, dtype will be inferred + If None, dtype will be inferred. .. versionadded:: 0.23.0 @@ -383,16 +383,16 @@ def from_arrays(cls, left, right, closed="right", copy=False, dtype=None): Parameters ---------- data : array-like (1-dimensional) - Array of tuples + Array of tuples. closed : {'left', 'right', 'both', 'neither'}, default 'right' Whether the intervals are closed on the left-side, right-side, both or neither. copy : bool, default False - by-default copy the data, this is compat only and ignored + By-default copy the data, this is compat only and ignored. dtype : dtype or None, default None - If None, dtype will be inferred + If None, dtype will be inferred. - ..versionadded:: 0.23.0 + .. versionadded:: 0.23.0 Returns ------- diff --git a/pandas/core/dtypes/concat.py b/pandas/core/dtypes/concat.py index f2176f573207c..a62d3d0f4e65b 100644 --- a/pandas/core/dtypes/concat.py +++ b/pandas/core/dtypes/concat.py @@ -185,13 +185,14 @@ def concat_categorical(to_concat, axis=0): def union_categoricals(to_union, sort_categories=False, ignore_order=False): """ - Combine list-like of Categorical-like, unioning categories. All - categories must have the same dtype. + Combine list-like of Categorical-like, unioning categories. + + All categories must have the same dtype. Parameters ---------- - to_union : list-like of Categorical, CategoricalIndex, - or Series with dtype='category' + to_union : list-like + Categorical, CategoricalIndex, or Series with dtype='category'. sort_categories : bool, default False If true, resulting categories will be lexsorted, otherwise they will be ordered as they appear in the data. @@ -201,7 +202,7 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False): Returns ------- - result : Categorical + Categorical Raises ------ diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 9d7ddcf3c7727..e418461883e6c 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -441,7 +441,7 @@ def pad(self, limit=None): Parameters ---------- limit : int, optional - limit of how many values to fill + Limit of how many values to fill. Returns ------- @@ -856,7 +856,7 @@ def var(self, ddof=1, *args, **kwargs): Parameters ---------- ddof : int, default 1 - degrees of freedom + Degrees of freedom. Returns ------- @@ -1237,11 +1237,11 @@ def _upsample(self, method, limit=None, fill_value=None): Parameters ---------- method : string {'backfill', 'bfill', 'pad', 'ffill'} - method for upsampling + Method for upsampling. limit : int, default None - Maximum size gap to fill when reindexing + Maximum size gap to fill when reindexing. fill_value : scalar, default None - Value to use for missing values + Value to use for missing values. See Also -------- diff --git a/pandas/io/html.py b/pandas/io/html.py index 7da7a819f81e8..9a368907b65aa 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -960,7 +960,7 @@ def read_html( This value is converted to a regular expression so that there is consistent behavior between Beautiful Soup and lxml. - flavor : str or None, container of strings + flavor : str or None The parsing engine to use. 'bs4' and 'html5lib' are synonymous with each other, they are both there for backwards compatibility. The default of ``None`` tries to use ``lxml`` to parse and if that fails it @@ -974,7 +974,7 @@ def read_html( The column (or list of columns) to use to create the index. skiprows : int or list-like or slice or None, optional - 0-based. Number of rows to skip after parsing the column integer. If a + Number of rows to skip after parsing the column integer. 0-based. If a sequence of integers or a slice is given, will skip the rows indexed by that sequence. Note that a single element sequence means 'skip the nth row' whereas an integer means 'skip n rows'. @@ -1024,18 +1024,19 @@ def read_html( transformed content. na_values : iterable, default None - Custom NA values + Custom NA values. keep_default_na : bool, default True If na_values are specified and keep_default_na is False the default NaN - values are overridden, otherwise they're appended to + values are overridden, otherwise they're appended to. displayed_only : bool, default True - Whether elements with "display: none" should be parsed + Whether elements with "display: none" should be parsed. Returns ------- - dfs : list of DataFrames + dfs + A list of DataFrames. See Also -------- diff --git a/pandas/util/testing.py b/pandas/util/testing.py index f3b0226547c78..5a2f189ad8d10 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -593,14 +593,14 @@ def assert_index_equal( check_less_precise : bool or int, default False Specify comparison precision. Only used when check_exact is False. 5 digits (False) or 3 digits (True) after decimal points are compared. - If int, then specify the digits to compare + If int, then specify the digits to compare. check_exact : bool, default True Whether to compare number exactly. check_categorical : bool, default True Whether to compare internal Categorical exactly. obj : str, default 'Index' Specify object name being compared, internally used to show appropriate - assertion message + assertion message. """ __tracebackhide__ = True @@ -1273,10 +1273,7 @@ def assert_frame_equal( check whether it is equivalent to 1 within the specified precision. check_names : bool, default True Whether to check that the `names` attribute for both the `index` - and `column` attributes of the DataFrame is identical, i.e. - - * left.index.names == right.index.names - * left.columns.names == right.columns.names + and `column` attributes of the DataFrame is identical. by_blocks : bool, default False Specify how to compare internal data. If False, compare by columns. If True, compare by blocks.