From 70a5415b2d14b62fc76081c4bdf808391a424b20 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 10:49:23 +0530 Subject: [PATCH 01/42] Fixed GL01 and GL02 in pandas.api --- pandas/api/extensions/__init__.py | 4 +++- pandas/api/types/__init__.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/api/extensions/__init__.py b/pandas/api/extensions/__init__.py index cb6241016d82f..0e1d66525e16a 100644 --- a/pandas/api/extensions/__init__.py +++ b/pandas/api/extensions/__init__.py @@ -1,4 +1,6 @@ -"""Public API for extending pandas objects.""" +""" +Public API for extending pandas objects. +""" from pandas.core.accessor import (register_dataframe_accessor, # noqa register_index_accessor, register_series_accessor) diff --git a/pandas/api/types/__init__.py b/pandas/api/types/__init__.py index 438e4afa3f580..f90ea1ad6b06c 100644 --- a/pandas/api/types/__init__.py +++ b/pandas/api/types/__init__.py @@ -1,4 +1,6 @@ -""" public toolkit API """ +""" +Public toolkit API +""" from pandas.core.dtypes.api import * # noqa from pandas.core.dtypes.dtypes import (CategoricalDtype, # noqa From f31369c3d8d265bd1b8f921be86728b729d6aca6 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 16:29:48 +0530 Subject: [PATCH 02/42] Error code: GL01,GL02 fixes for pandas.HDFStore --- pandas/io/pytables.py | 86 ++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 25 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 0f7f6fe399256..e4eab6217a9e1 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1082,7 +1082,8 @@ def create_table_index(self, key, **kwargs): s.create_index(**kwargs) def groups(self): - """return a list of all the top-level nodes (that are not themselves a + """ + Return a list of all the top-level nodes (that are not themselves a pandas storage object) Returns @@ -1101,7 +1102,8 @@ def groups(self): ] def walk(self, where="/"): - """ Walk the pytables group hierarchy for pandas objects + """ + Walk the pytables group hierarchy for pandas objects This generator will yield the group path, subgroups and pandas object names for each group. @@ -1147,7 +1149,9 @@ def walk(self, where="/"): yield (g._v_pathname.rstrip('/'), groups, leaves) def get_node(self, key): - """ return the node with the key or None if it does not exist """ + """ + Return the node with the key or None if it does not exist + """ self._check_if_open() try: if not key.startswith('/'): @@ -1157,7 +1161,9 @@ def get_node(self, key): return None def get_storer(self, key): - """ return the storer object for a key, raise if not in the file """ + """ + Return the storer object for a key, raise if not in the file + """ group = self.get_node(key) if group is None: raise KeyError('No object named {key} in the file'.format(key=key)) @@ -1168,7 +1174,8 @@ def get_storer(self, key): def copy(self, file, mode='w', propindexes=True, keys=None, complib=None, complevel=None, fletcher32=False, overwrite=True): - """ copy the existing store to a new file, upgrading in place + """ + Copy the existing store to a new file, upgrading in place Parameters ---------- @@ -1181,7 +1188,6 @@ def copy(self, file, mode='w', propindexes=True, keys=None, complib=None, Returns ------- open file handle of the new store - """ new_store = HDFStore( file, @@ -1262,7 +1268,9 @@ def _check_if_open(self): raise ClosedFileError("{0} file is not open!".format(self._path)) def _validate_format(self, format, kwargs): - """ validate / deprecate formats; return the new kwargs """ + """ + Validate / deprecate formats; return the new kwargs + """ kwargs = kwargs.copy() # validate @@ -1276,7 +1284,9 @@ def _validate_format(self, format, kwargs): def _create_storer(self, group, format=None, value=None, append=False, **kwargs): - """ return a suitable class to operate """ + """ + Return a suitable class to operate + """ def error(t): raise TypeError( @@ -1424,7 +1434,8 @@ def _read_group(self, group, **kwargs): class TableIterator: - """ define the iteration interface on a table + """ + Define the iteration interface on a table Parameters ---------- @@ -1441,7 +1452,7 @@ class TableIterator: auto_close : boolean, automatically close the store at the end of iteration, default is False kwargs : the passed kwargs - """ + """ def __init__(self, store, s, func, where, nrows, start=None, stop=None, iterator=False, chunksize=None, auto_close=False): @@ -1521,7 +1532,8 @@ def get_result(self, coordinates=False): class IndexCol(StringMixin): - """ an index column description class + """ + An index column description class Parameters ---------- @@ -1532,7 +1544,7 @@ class IndexCol(StringMixin): typ : the pytables type pos : the position in the pytables - """ + """ is_an_indexable = True is_data_indexable = True _info_fields = ['freq', 'tz', 'index_name'] @@ -1562,7 +1574,9 @@ def __init__(self, values=None, kind=None, typ=None, cname=None, self.set_pos(pos) def set_name(self, name, kind_attr=None): - """ set the name of this indexer """ + """ + Set the name of this indexer + """ self.name = name self.kind_attr = kind_attr or "{name}_kind".format(name=name) if self.cname is None: @@ -1571,13 +1585,17 @@ def set_name(self, name, kind_attr=None): return self def set_axis(self, axis): - """ set the axis over which I index """ + """ + Set the axis over which I index + """ self.axis = axis return self def set_pos(self, pos): - """ set the position of this column in the Table """ + """ + Set the position of this column in the Table + """ self.pos = pos if pos is not None and self.typ is not None: self.typ._v_pos = pos @@ -1600,7 +1618,9 @@ def __str__(self): ['name', 'cname', 'axis', 'pos', 'kind'], temp))) def __eq__(self, other): - """ compare 2 col items """ + """ + Compare 2 col items + """ return all(getattr(self, a, None) == getattr(other, a, None) for a in ['name', 'cname', 'axis', 'pos']) @@ -1609,7 +1629,9 @@ def __ne__(self, other): @property def is_indexed(self): - """ return whether I am an indexed column """ + """ + Return whether I am an indexed column + """ try: return getattr(self.table.cols, self.cname).is_indexed except AttributeError: @@ -1620,7 +1642,9 @@ def copy(self): return new_self def infer(self, handler): - """infer this column from the table: create and return a new object""" + """ + Infer this column from the table: create and return a new object + """ table = handler.table new_self = self.copy() new_self.set_table(table) @@ -1629,7 +1653,9 @@ def infer(self, handler): return new_self def convert(self, values, nan_rep, encoding, errors): - """ set the values from this selection: take = take ownership """ + """ + Set the values from this selection: take = take ownership + """ # values is a recarray if values.dtype.fields is not None: @@ -1658,7 +1684,9 @@ def convert(self, values, nan_rep, encoding, errors): return self def take_data(self): - """ return the values & release the memory """ + """ + Return the values & release the memory + """ self.values, values = None, self.values return values @@ -1672,21 +1700,27 @@ def description(self): @property def col(self): - """ return my current col description """ + """ + Return my current col description + """ return getattr(self.description, self.cname, None) @property def cvalues(self): - """ return my cython values """ + """ + Return my cython values + """ return self.values def __iter__(self): return iter(self.values) def maybe_set_size(self, min_itemsize=None): - """ maybe set a string col itemsize: + """ + Maybe set a string col itemsize: min_itemsize can be an integer or a dict with this columns name - with an integer size """ + with an integer size + """ if _ensure_decoded(self.kind) == 'string': if isinstance(min_itemsize, dict): @@ -1711,7 +1745,9 @@ def validate_and_set(self, handler, append): self.set_attr() def validate_col(self, itemsize=None): - """ validate this column: return the compared against itemsize """ + """ + Validate this column: return the compared against itemsize + """ # validate this column for string truncation (or reset to the max size) if _ensure_decoded(self.kind) == 'string': From 1b6f06c83046db3445bd942543d714508d71fb8c Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 16:35:50 +0530 Subject: [PATCH 03/42] fixing the pep8 issue that was generated --- pandas/api/types/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/api/types/__init__.py b/pandas/api/types/__init__.py index f90ea1ad6b06c..7638377daa24e 100644 --- a/pandas/api/types/__init__.py +++ b/pandas/api/types/__init__.py @@ -1,5 +1,5 @@ -""" -Public toolkit API +""" +Public toolkit API """ from pandas.core.dtypes.api import * # noqa From bef77ae835ca303826c8611e60c6699fc80182c0 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 16:48:10 +0530 Subject: [PATCH 04/42] Fixing GL01,GL02 on pandas.core.resample.Resampler.pipe --- pandas/core/groupby/groupby.py | 5 +++-- pandas/core/resample.py | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index aa04b7505afe4..64214adcce098 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -171,7 +171,7 @@ class providing the base-class of operations. {examples} """) -_pipe_template = """\ +_pipe_template = """ Apply a function `func` with arguments to this %(klass)s object and return the function's result. @@ -222,7 +222,8 @@ class providing the base-class of operations. Examples -------- -%(examples)s""" +%(examples)s +""" _transform_template = """ Call function producing a like-indexed %(klass)s on each group and diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 874973846a006..d1d99d28e59b6 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -204,8 +204,7 @@ def _assure_grouper(self): >>> df.resample('2D').pipe(lambda x: x.max() - x.min()) A 2012-08-02 1 - 2012-08-04 1 - """) + 2012-08-04 1""") @Appender(_pipe_template) def pipe(self, func, *args, **kwargs): return super().pipe(func, *args, **kwargs) From 25674cbeca534e07c385e18d0eb787121420dfff Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 17:03:02 +0530 Subject: [PATCH 05/42] GL01,GL02 fix for pandas.Series.T --- pandas/core/base.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 3f59871fb5b38..66774895c8f13 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -634,7 +634,8 @@ def _is_builtin_func(self, arg): class IndexOpsMixin: - """ common ops mixin to support a unified interface / docs for Series / + """ + Common ops mixin to support a unified interface / docs for Series / Index """ @@ -652,8 +653,10 @@ def transpose(self, *args, **kwargs): nv.validate_transpose(args, kwargs) return self - T = property(transpose, doc="Return the transpose, which is by " - "definition self.") + T = property(transpose, doc=""" + Return the transpose, which is by + definition self. + """) @property def _is_homogeneous_type(self): From a894109c0e797d02b97c6c04bff283d5f08eec3b Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 19:56:30 +0530 Subject: [PATCH 06/42] fixed pandas.api GL01,GL02 --- pandas/api/__init__.py | 4 +++- pandas/core/accessor.py | 6 ++---- pandas/core/dtypes/inference.py | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pandas/api/__init__.py b/pandas/api/__init__.py index afff059e7b601..a8a176a06bea7 100644 --- a/pandas/api/__init__.py +++ b/pandas/api/__init__.py @@ -1,2 +1,4 @@ -""" public toolkit API """ +""" +Public toolkit API +""" from . import types, extensions # noqa diff --git a/pandas/core/accessor.py b/pandas/core/accessor.py index 4353e0b3edd08..5fc60a791795f 100644 --- a/pandas/core/accessor.py +++ b/pandas/core/accessor.py @@ -1,8 +1,6 @@ """ - -accessor.py contains base classes for implementing accessor properties +Accessor.py contains base classes for implementing accessor properties that can be mixed into or pinned onto other pandas classes. - """ from typing import Set import warnings @@ -196,7 +194,7 @@ def decorator(accessor): return decorator -_doc = """\ +_doc = """ Register a custom accessor on %(klass)s objects. Parameters diff --git a/pandas/core/dtypes/inference.py b/pandas/core/dtypes/inference.py index 63cb4d85ca308..02ee777bbe7f3 100644 --- a/pandas/core/dtypes/inference.py +++ b/pandas/core/dtypes/inference.py @@ -427,7 +427,8 @@ def is_named_tuple(obj): def is_hashable(obj): - """Return True if hash(obj) will succeed, False otherwise. + """ + Return True if hash(obj) will succeed, False otherwise. Some types will pass a test against collections.abc.Hashable but fail when they are actually hashed with hash(). From 01313a93d77febcefb19f280c6136a36449c996c Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 20:13:50 +0530 Subject: [PATCH 07/42] GL01 GL02 fix on read_html --- pandas/io/html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/io/html.py b/pandas/io/html.py index cbdc513cfbbe3..1e779e3e430b2 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -924,7 +924,8 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None, tupleize_cols=None, thousands=',', encoding=None, decimal='.', converters=None, na_values=None, keep_default_na=True, displayed_only=True): - r"""Read HTML tables into a ``list`` of ``DataFrame`` objects. + """ + Read HTML tables into a ``list`` of ``DataFrame`` objects. Parameters ---------- From c823d8890821fe4bce35fd7000fae11a2c00fc75 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 20:14:16 +0530 Subject: [PATCH 08/42] GL01 GL02 fix on read_sql_query --- pandas/io/sql.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 1e3fe2ade6ab7..e1d5931b9380d 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -246,7 +246,8 @@ def read_sql_table(table_name, con, schema=None, index_col=None, def read_sql_query(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, chunksize=None): - """Read SQL query into a DataFrame. + """ + Read SQL query into a DataFrame. Returns a DataFrame corresponding to the result set of the query string. Optionally provide an `index_col` parameter to use one of the From 385504634d42d49ac8cceeebd64c98848f39e21a Mon Sep 17 00:00:00 2001 From: Mathew George Date: Sun, 26 May 2019 23:30:57 +0530 Subject: [PATCH 09/42] GL01,GL02 solved for pandas.IntervalIndex --- pandas/core/arrays/interval.py | 4 ++-- pandas/core/indexes/interval.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index 94b9dc8ebab55..846f38a6e139a 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -987,7 +987,7 @@ def __array__(self, dtype=None): result[i] = Interval(left[i], right[i], closed) return result - _interval_shared_docs['to_tuples'] = """\ + _interval_shared_docs['to_tuples'] = """ Return an %(return_type)s of tuples of the form (left, right) Parameters @@ -1001,7 +1001,7 @@ def __array__(self, dtype=None): Returns ------- tuples: %(return_type)s - %(examples)s\ + %(examples)s """ @Appender(_interval_shared_docs['to_tuples'] % dict( diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index 87216dcc7b957..6bec00b983c2d 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -716,7 +716,8 @@ def _find_non_overlapping_monotonic_bounds(self, key): return start, stop def get_loc(self, key, method=None): - """Get integer location, slice or boolean mask for requested label. + """ + Get integer location, slice or boolean mask for requested label. Parameters ---------- From a194e67d8521b8e14e56f04e450bcdd73bc2cf28 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 20:12:31 +0530 Subject: [PATCH 10/42] fixed .ix for DataFrame,Series and Panel --- pandas/core/indexing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 3c7a286c8a4f8..092bea65355d6 100755 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -1387,7 +1387,8 @@ def _get_slice_axis(self, slice_obj, axis=None): class _IXIndexer(_NDFrameIndexer): - """A primarily label-location based indexer, with integer position + """ + A primarily label-location based indexer, with integer position fallback. Warning: Starting in 0.20.0, the .ix indexer is deprecated, in From e54659572163487beee6df09fc8febd2534ed383 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 20:18:35 +0530 Subject: [PATCH 11/42] pandas.io.stata.StataReader.data deprecated method doc updated for GL01GL02 errors --- pandas/io/stata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 27ddc4ef6f594..18cbcd49dcca7 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -116,7 +116,7 @@ _statafile_processing_params2, _chunksize_params, _iterator_params) -_data_method_doc = """\ +_data_method_doc = """ Read observations from Stata file, converting them into a dataframe .. deprecated:: From 41953de236251489859f69227426b94782b94a31 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 20:53:14 +0530 Subject: [PATCH 12/42] GL01,GL02 error fix for pandas.eval --- pandas/core/computation/eval.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index 8f6c271af4a58..ef4639a3afe4c 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -1,6 +1,7 @@ #!/usr/bin/env python -"""Top level ``eval`` module. +""" +Top level ``eval`` module. """ import tokenize @@ -15,7 +16,8 @@ def _check_engine(engine): - """Make sure a valid engine is passed. + """ + Make sure a valid engine is passed. Parameters ---------- @@ -31,7 +33,6 @@ def _check_engine(engine): Returns ------- string engine - """ from pandas.core.computation.check import _NUMEXPR_INSTALLED @@ -60,7 +61,8 @@ def _check_engine(engine): def _check_parser(parser): - """Make sure a valid parser is passed. + """ + Make sure a valid parser is passed. Parameters ---------- @@ -88,7 +90,8 @@ def _check_resolvers(resolvers): def _check_expression(expr): - """Make sure an expression is not an empty string + """ + Make sure an expression is not an empty string Parameters ---------- @@ -105,7 +108,8 @@ def _check_expression(expr): def _convert_expression(expr): - """Convert an object to an expression. + """ + Convert an object to an expression. Thus function converts an object to an expression (a unicode string) and checks to make sure it isn't empty after conversion. This is used to @@ -155,7 +159,8 @@ def _check_for_locals(expr, stack_level, parser): def eval(expr, parser='pandas', engine=None, truediv=True, local_dict=None, global_dict=None, resolvers=(), level=0, target=None, inplace=False): - """Evaluate a Python expression as a string using various backends. + """ + Evaluate a Python expression as a string using various backends. The following arithmetic operations are supported: ``+``, ``-``, ``*``, ``/``, ``**``, ``%``, ``//`` (python engine only) along with the following From 63b8e0cef4e4d9ecc414d5312949233c1d0a2d08 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 20:56:47 +0530 Subject: [PATCH 13/42] Fixed GL01,GL02 for pandas.merge and pandas.merge_asof --- pandas/core/reshape/merge.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 1a80b35629356..d21ad58e752c2 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -133,7 +133,8 @@ def merge_ordered(left, right, on=None, left_by=None, right_by=None, fill_method=None, suffixes=('_x', '_y'), how='outer'): - """Perform merge with optional filling/interpolation designed for ordered + """ + Perform merge with optional filling/interpolation designed for ordered data like time series data. Optionally perform group-wise merge (see examples) @@ -240,7 +241,8 @@ def merge_asof(left, right, on=None, tolerance=None, allow_exact_matches=True, direction='backward'): - """Perform an asof merge. This is similar to a left-join except that we + """ + Perform an asof merge. This is similar to a left-join except that we match on nearest key rather than equal keys. Both DataFrames must be sorted by the key. From 5ad9a5e6fa6e5fa4a193361acf934130c2ffba2e Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 20:59:47 +0530 Subject: [PATCH 14/42] fixed pandas.testing GL01,GL02 --- pandas/util/testing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 92d450140a891..03d826dc296b0 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -518,7 +518,8 @@ def equalContents(arr1, arr2): def assert_index_equal(left, right, exact='equiv', check_names=True, check_less_precise=False, check_exact=True, check_categorical=True, obj='Index'): - """Check that left and right Index are equal. + """ + Check that left and right Index are equal. Parameters ---------- @@ -972,7 +973,8 @@ def assert_series_equal(left, right, check_dtype=True, check_datetimelike_compat=False, check_categorical=True, obj='Series'): - """Check that left and right Series are equal. + """ + Check that left and right Series are equal. Parameters ---------- From 3a41220622719781b697136897715cae141fd259 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 21:02:09 +0530 Subject: [PATCH 15/42] fixed GL01,GL02 for pandas.plotting --- pandas/plotting/_misc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index f153cdeee268f..710330e0bfc97 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -457,7 +457,8 @@ def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None, use_columns=False, xticks=None, colormap=None, axvlines=True, axvlines_kwds=None, sort_labels=False, **kwds): - """Parallel coordinates plotting. + """ + Parallel coordinates plotting. Parameters ---------- @@ -568,7 +569,8 @@ def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None, def lag_plot(series, lag=1, ax=None, **kwds): - """Lag plot for time series. + """ + Lag plot for time series. Parameters ---------- From 4daacc5216eccf461eb26f1813b8b0ca4f4e902d Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 21:05:52 +0530 Subject: [PATCH 16/42] fixed pandas.IntervalDtype GL01,GL02 --- pandas/core/dtypes/dtypes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 32047c3fbb5e1..a3580cf63317f 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -957,7 +957,9 @@ def __new__(cls, subtype=None): @property def subtype(self): - """The dtype of the Interval bounds.""" + """ + The dtype of the Interval bounds. + """ return self._subtype @classmethod From 61375621111a63b844e6cd1d0aa5a542fe08f0dc Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 21:10:45 +0530 Subject: [PATCH 17/42] Fixed GL01,GL02 pandas.PeriodDtype --- pandas/core/dtypes/dtypes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index a3580cf63317f..46d29494d0364 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -790,7 +790,9 @@ def __new__(cls, freq=None): @property def freq(self): - """The frequency object of this PeriodDtype.""" + """ + The frequency object of this PeriodDtype. + """ return self._freq @classmethod From 652052113a2137f2f2876edd93d1e64a3d2da8f4 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 21:13:02 +0530 Subject: [PATCH 18/42] Fixed GL01,GL02 pandas.DatetimeTZDtype errors --- pandas/core/dtypes/dtypes.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 46d29494d0364..3a55bffcba7e8 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -644,12 +644,16 @@ def __init__(self, unit="ns", tz=None): @property def unit(self): - """The precision of the datetime data.""" + """ + The precision of the datetime data. + """ return self._unit @property def tz(self): - """The timezone.""" + """ + The timezone. + """ return self._tz @classmethod From 66486b8e0dcffe5cdc7a9a1948119999a304bdea Mon Sep 17 00:00:00 2001 From: Mathew George Date: Mon, 27 May 2019 21:38:47 +0530 Subject: [PATCH 19/42] GL01,GL02 fixes MultiIndex --- pandas/core/indexes/multi.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index f1553d9db835f..cba2b838b6a75 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1077,7 +1077,9 @@ def _set_names(self, names, level=None, validate=True): self.levels[l].rename(name, inplace=True) names = property(fset=_set_names, fget=_get_names, - doc="Names of levels in MultiIndex") + doc=""" + Names of levels in MultiIndex + """) @Appender(_index_shared_docs['_get_grouper_for_level']) def _get_grouper_for_level(self, mapper, level): @@ -1731,12 +1733,16 @@ def remove_unused_levels(self): @property def nlevels(self): - """Integer number of levels in this MultiIndex.""" + """ + Integer number of levels in this MultiIndex. + """ return len(self.levels) @property def levshape(self): - """A tuple with the length of each level.""" + """ + A tuple with the length of each level. + """ return tuple(len(x) for x in self.levels) def __reduce__(self): From 2811f0a566feffb28d47de162f9eb155dfff1f62 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Tue, 28 May 2019 20:35:57 +0530 Subject: [PATCH 20/42] GL01 for Panel.iteritems --- pandas/core/generic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 76c73fc40977c..671bf3ce09e27 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -1862,7 +1862,8 @@ def __iter__(self): # can we get a better explanation of this? def keys(self): - """Get the 'info axis' (see Indexing for more) + """ + Get the 'info axis' (see Indexing for more) This is index for Series, columns for DataFrame. @@ -1874,7 +1875,8 @@ def keys(self): return self._info_axis def iteritems(self): - """Iterate over (label, values) on info axis + """ + Iterate over (label, values) on info axis This is index for Series, columns for DataFrame and so on. """ From 8b0ace9601a67e046a9851164cd04c4539b5d31f Mon Sep 17 00:00:00 2001 From: Mathew George Date: Tue, 28 May 2019 23:21:50 +0530 Subject: [PATCH 21/42] GL01 fix pandas.DataFrame.plot --- pandas/plotting/_core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index fed4b0d90983c..084b13f560417 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2945,7 +2945,8 @@ def pie(self, **kwds): class FramePlotMethods(BasePlotMethods): - """DataFrame plotting accessor and method + """ + DataFrame plotting accessor and method Examples -------- From 281244edd3eda7cfcd57dded0a911a73718b5951 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Tue, 28 May 2019 23:23:00 +0530 Subject: [PATCH 22/42] GL01 fix for pandas.Categorical.codes --- pandas/core/arrays/categorical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 0fa705369908a..694d6448c900e 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -191,7 +191,7 @@ def contains(cat, key, container): return any(loc_ in container for loc_ in loc) -_codes_doc = """\ +_codes_doc = """ The category codes of this categorical. Level codes are an array if integer which are the positions of the real From c6dfcf7e83d8efa2de50ff0a9167d73bc4afb813 Mon Sep 17 00:00:00 2001 From: Mathew George Date: Wed, 29 May 2019 07:09:44 +0530 Subject: [PATCH 23/42] Reverting module level docstring to original as validate_docstrings does not check module level docstrings --- pandas/api/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/api/__init__.py b/pandas/api/__init__.py index a8a176a06bea7..d695f737b0b55 100644 --- a/pandas/api/__init__.py +++ b/pandas/api/__init__.py @@ -1,4 +1,2 @@ -""" -Public toolkit API -""" +"""public toolkit API""" from . import types, extensions # noqa From 01acfd0a246ec4086df112e4bcf46fa6149a0896 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 11:49:12 +0530 Subject: [PATCH 24/42] reverting module docstring --- pandas/api/extensions/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/api/extensions/__init__.py b/pandas/api/extensions/__init__.py index 0e1d66525e16a..cb6241016d82f 100644 --- a/pandas/api/extensions/__init__.py +++ b/pandas/api/extensions/__init__.py @@ -1,6 +1,4 @@ -""" -Public API for extending pandas objects. -""" +"""Public API for extending pandas objects.""" from pandas.core.accessor import (register_dataframe_accessor, # noqa register_index_accessor, register_series_accessor) From 1fbc33f365f1a761f79de62c2d544a418854017c Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 11:49:53 +0530 Subject: [PATCH 25/42] reverting module level docstring changes --- pandas/api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/api/__init__.py b/pandas/api/__init__.py index d695f737b0b55..afff059e7b601 100644 --- a/pandas/api/__init__.py +++ b/pandas/api/__init__.py @@ -1,2 +1,2 @@ -"""public toolkit API""" +""" public toolkit API """ from . import types, extensions # noqa From f19dc4b14f0ef7dd2dde851ebc318c30e1a8d185 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:01:55 +0530 Subject: [PATCH 26/42] reverting changes outside pandas.core --- pandas/io/html.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/io/html.py b/pandas/io/html.py index 1e779e3e430b2..cbdc513cfbbe3 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -924,8 +924,7 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None, tupleize_cols=None, thousands=',', encoding=None, decimal='.', converters=None, na_values=None, keep_default_na=True, displayed_only=True): - """ - Read HTML tables into a ``list`` of ``DataFrame`` objects. + r"""Read HTML tables into a ``list`` of ``DataFrame`` objects. Parameters ---------- From 27438f56eaf2aedb2b1ca7bc4aba1a10cdb2ea9b Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:03:05 +0530 Subject: [PATCH 27/42] reverting changes outside pandas.core --- pandas/io/pytables.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index e4eab6217a9e1..e3fc12359e3d1 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1082,8 +1082,7 @@ def create_table_index(self, key, **kwargs): s.create_index(**kwargs) def groups(self): - """ - Return a list of all the top-level nodes (that are not themselves a + """return a list of all the top-level nodes (that are not themselves a pandas storage object) Returns From d8790f48f102ee7f8d55ec51c76dc0d4e7844b3a Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:03:45 +0530 Subject: [PATCH 28/42] reverting changes outside pandas.core --- pandas/io/sql.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/io/sql.py b/pandas/io/sql.py index e1d5931b9380d..1e3fe2ade6ab7 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -246,8 +246,7 @@ def read_sql_table(table_name, con, schema=None, index_col=None, def read_sql_query(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, chunksize=None): - """ - Read SQL query into a DataFrame. + """Read SQL query into a DataFrame. Returns a DataFrame corresponding to the result set of the query string. Optionally provide an `index_col` parameter to use one of the From ff3ebab58898311c28392697caf9fac5075e7716 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:04:27 +0530 Subject: [PATCH 29/42] reverting changes outside pandas.core --- pandas/io/stata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 18cbcd49dcca7..27ddc4ef6f594 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -116,7 +116,7 @@ _statafile_processing_params2, _chunksize_params, _iterator_params) -_data_method_doc = """ +_data_method_doc = """\ Read observations from Stata file, converting them into a dataframe .. deprecated:: From 63426ebcadfd27034770750d05549596aa9f9119 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:05:11 +0530 Subject: [PATCH 30/42] reverted changes outside pandas.core --- pandas/plotting/_core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 084b13f560417..fed4b0d90983c 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2945,8 +2945,7 @@ def pie(self, **kwds): class FramePlotMethods(BasePlotMethods): - """ - DataFrame plotting accessor and method + """DataFrame plotting accessor and method Examples -------- From 1b0527edfb2db055fa3c9d55a94c5928f963b141 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:05:48 +0530 Subject: [PATCH 31/42] reverting changes outside pandas.core --- pandas/plotting/_misc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 710330e0bfc97..90ebba3fca747 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -457,8 +457,7 @@ def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None, use_columns=False, xticks=None, colormap=None, axvlines=True, axvlines_kwds=None, sort_labels=False, **kwds): - """ - Parallel coordinates plotting. + """Parallel coordinates plotting. Parameters ---------- From 654b166fa72058518e38220fa52e106a1d4a7d84 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:07:04 +0530 Subject: [PATCH 32/42] reverting changes outside pandas.core --- pandas/util/testing.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 03d826dc296b0..92d450140a891 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -518,8 +518,7 @@ def equalContents(arr1, arr2): def assert_index_equal(left, right, exact='equiv', check_names=True, check_less_precise=False, check_exact=True, check_categorical=True, obj='Index'): - """ - Check that left and right Index are equal. + """Check that left and right Index are equal. Parameters ---------- @@ -973,8 +972,7 @@ def assert_series_equal(left, right, check_dtype=True, check_datetimelike_compat=False, check_categorical=True, obj='Series'): - """ - Check that left and right Series are equal. + """Check that left and right Series are equal. Parameters ---------- From a3e9376d567f1afcf11088f2de018087414dd91b Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:07:44 +0530 Subject: [PATCH 33/42] reverting changes outside pandas.core --- pandas/api/types/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/api/types/__init__.py b/pandas/api/types/__init__.py index 7638377daa24e..438e4afa3f580 100644 --- a/pandas/api/types/__init__.py +++ b/pandas/api/types/__init__.py @@ -1,6 +1,4 @@ -""" -Public toolkit API -""" +""" public toolkit API """ from pandas.core.dtypes.api import * # noqa from pandas.core.dtypes.dtypes import (CategoricalDtype, # noqa From 558a527963fd0be5efac62583407810aa0d2bd4b Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:08:52 +0530 Subject: [PATCH 34/42] reverting changes outside pandas.core --- pandas/plotting/_misc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 90ebba3fca747..f153cdeee268f 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -568,8 +568,7 @@ def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None, def lag_plot(series, lag=1, ax=None, **kwds): - """ - Lag plot for time series. + """Lag plot for time series. Parameters ---------- From 44368aec699b17a2b7af95363946e3112abb9729 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:16:47 +0530 Subject: [PATCH 35/42] reverting changes outside pandas.core --- pandas/io/pytables.py | 80 +++++++++++++------------------------------ 1 file changed, 24 insertions(+), 56 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index e3fc12359e3d1..7ed324f6eb6b0 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1101,8 +1101,7 @@ def groups(self): ] def walk(self, where="/"): - """ - Walk the pytables group hierarchy for pandas objects + """ Walk the pytables group hierarchy for pandas objects This generator will yield the group path, subgroups and pandas object names for each group. @@ -1148,8 +1147,7 @@ def walk(self, where="/"): yield (g._v_pathname.rstrip('/'), groups, leaves) def get_node(self, key): - """ - Return the node with the key or None if it does not exist + """ return the node with the key or None if it does not exist """ self._check_if_open() try: @@ -1160,8 +1158,7 @@ def get_node(self, key): return None def get_storer(self, key): - """ - Return the storer object for a key, raise if not in the file + """ return the storer object for a key, raise if not in the file """ group = self.get_node(key) if group is None: @@ -1173,8 +1170,7 @@ def get_storer(self, key): def copy(self, file, mode='w', propindexes=True, keys=None, complib=None, complevel=None, fletcher32=False, overwrite=True): - """ - Copy the existing store to a new file, upgrading in place + """ copy the existing store to a new file, upgrading in place Parameters ---------- @@ -1187,6 +1183,7 @@ def copy(self, file, mode='w', propindexes=True, keys=None, complib=None, Returns ------- open file handle of the new store + """ new_store = HDFStore( file, @@ -1267,8 +1264,7 @@ def _check_if_open(self): raise ClosedFileError("{0} file is not open!".format(self._path)) def _validate_format(self, format, kwargs): - """ - Validate / deprecate formats; return the new kwargs + """ validate / deprecate formats; return the new kwargs """ kwargs = kwargs.copy() @@ -1283,9 +1279,7 @@ def _validate_format(self, format, kwargs): def _create_storer(self, group, format=None, value=None, append=False, **kwargs): - """ - Return a suitable class to operate - """ + """ return a suitable class to operate """ def error(t): raise TypeError( @@ -1433,8 +1427,7 @@ def _read_group(self, group, **kwargs): class TableIterator: - """ - Define the iteration interface on a table + """ define the iteration interface on a table Parameters ---------- @@ -1451,7 +1444,7 @@ class TableIterator: auto_close : boolean, automatically close the store at the end of iteration, default is False kwargs : the passed kwargs - """ + """ def __init__(self, store, s, func, where, nrows, start=None, stop=None, iterator=False, chunksize=None, auto_close=False): @@ -1531,8 +1524,7 @@ def get_result(self, coordinates=False): class IndexCol(StringMixin): - """ - An index column description class + """ an index column description class Parameters ---------- @@ -1543,7 +1535,7 @@ class IndexCol(StringMixin): typ : the pytables type pos : the position in the pytables - """ + """ is_an_indexable = True is_data_indexable = True _info_fields = ['freq', 'tz', 'index_name'] @@ -1573,9 +1565,7 @@ def __init__(self, values=None, kind=None, typ=None, cname=None, self.set_pos(pos) def set_name(self, name, kind_attr=None): - """ - Set the name of this indexer - """ + """ set the name of this indexer """ self.name = name self.kind_attr = kind_attr or "{name}_kind".format(name=name) if self.cname is None: @@ -1584,17 +1574,13 @@ def set_name(self, name, kind_attr=None): return self def set_axis(self, axis): - """ - Set the axis over which I index - """ + """ set the axis over which I index """ self.axis = axis return self def set_pos(self, pos): - """ - Set the position of this column in the Table - """ + """ set the position of this column in the Table """ self.pos = pos if pos is not None and self.typ is not None: self.typ._v_pos = pos @@ -1617,9 +1603,7 @@ def __str__(self): ['name', 'cname', 'axis', 'pos', 'kind'], temp))) def __eq__(self, other): - """ - Compare 2 col items - """ + """ compare 2 col items """ return all(getattr(self, a, None) == getattr(other, a, None) for a in ['name', 'cname', 'axis', 'pos']) @@ -1628,9 +1612,7 @@ def __ne__(self, other): @property def is_indexed(self): - """ - Return whether I am an indexed column - """ + """ return whether I am an indexed column """ try: return getattr(self.table.cols, self.cname).is_indexed except AttributeError: @@ -1641,9 +1623,7 @@ def copy(self): return new_self def infer(self, handler): - """ - Infer this column from the table: create and return a new object - """ + """infer this column from the table: create and return a new object""" table = handler.table new_self = self.copy() new_self.set_table(table) @@ -1652,9 +1632,7 @@ def infer(self, handler): return new_self def convert(self, values, nan_rep, encoding, errors): - """ - Set the values from this selection: take = take ownership - """ + """ set the values from this selection: take = take ownership """ # values is a recarray if values.dtype.fields is not None: @@ -1683,9 +1661,7 @@ def convert(self, values, nan_rep, encoding, errors): return self def take_data(self): - """ - Return the values & release the memory - """ + """ return the values & release the memory """ self.values, values = None, self.values return values @@ -1699,27 +1675,21 @@ def description(self): @property def col(self): - """ - Return my current col description - """ + """ return my current col description """ return getattr(self.description, self.cname, None) @property def cvalues(self): - """ - Return my cython values - """ + """ return my cython values """ return self.values def __iter__(self): return iter(self.values) def maybe_set_size(self, min_itemsize=None): - """ - Maybe set a string col itemsize: + """ maybe set a string col itemsize: min_itemsize can be an integer or a dict with this columns name - with an integer size - """ + with an integer size""" if _ensure_decoded(self.kind) == 'string': if isinstance(min_itemsize, dict): @@ -1744,9 +1714,7 @@ def validate_and_set(self, handler, append): self.set_attr() def validate_col(self, itemsize=None): - """ - Validate this column: return the compared against itemsize - """ + """ validate this column: return the compared against itemsize """ # validate this column for string truncation (or reset to the max size) if _ensure_decoded(self.kind) == 'string': From 8ff21106ff1f053fb54a1cbdc5558cceade40c45 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Wed, 29 May 2019 12:19:33 +0530 Subject: [PATCH 36/42] correcting reverted changes to pandas.io.pytables --- pandas/io/pytables.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 7ed324f6eb6b0..0f7f6fe399256 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1147,8 +1147,7 @@ def walk(self, where="/"): yield (g._v_pathname.rstrip('/'), groups, leaves) def get_node(self, key): - """ return the node with the key or None if it does not exist - """ + """ return the node with the key or None if it does not exist """ self._check_if_open() try: if not key.startswith('/'): @@ -1158,8 +1157,7 @@ def get_node(self, key): return None def get_storer(self, key): - """ return the storer object for a key, raise if not in the file - """ + """ return the storer object for a key, raise if not in the file """ group = self.get_node(key) if group is None: raise KeyError('No object named {key} in the file'.format(key=key)) @@ -1183,7 +1181,7 @@ def copy(self, file, mode='w', propindexes=True, keys=None, complib=None, Returns ------- open file handle of the new store - + """ new_store = HDFStore( file, @@ -1264,8 +1262,7 @@ def _check_if_open(self): raise ClosedFileError("{0} file is not open!".format(self._path)) def _validate_format(self, format, kwargs): - """ validate / deprecate formats; return the new kwargs - """ + """ validate / deprecate formats; return the new kwargs """ kwargs = kwargs.copy() # validate @@ -1689,7 +1686,7 @@ def __iter__(self): def maybe_set_size(self, min_itemsize=None): """ maybe set a string col itemsize: min_itemsize can be an integer or a dict with this columns name - with an integer size""" + with an integer size """ if _ensure_decoded(self.kind) == 'string': if isinstance(min_itemsize, dict): From 31cb387706aa8cae4ef9b0834892f0f7be699e3e Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Fri, 31 May 2019 20:21:12 +0530 Subject: [PATCH 37/42] updating accessor --- pandas/core/accessor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/accessor.py b/pandas/core/accessor.py index 5fc60a791795f..86ed26216b761 100644 --- a/pandas/core/accessor.py +++ b/pandas/core/accessor.py @@ -1,5 +1,6 @@ """ -Accessor.py contains base classes for implementing accessor properties + +accessor.py contains base classes for implementing accessor properties that can be mixed into or pinned onto other pandas classes. """ from typing import Set From e19bbc03ae6f462a3aea68abf0ec782e0e17613a Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Fri, 31 May 2019 20:21:47 +0530 Subject: [PATCH 38/42] accessor fix --- pandas/core/accessor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/accessor.py b/pandas/core/accessor.py index 86ed26216b761..b092541da93e6 100644 --- a/pandas/core/accessor.py +++ b/pandas/core/accessor.py @@ -2,6 +2,7 @@ accessor.py contains base classes for implementing accessor properties that can be mixed into or pinned onto other pandas classes. + """ from typing import Set import warnings From 31eaf2674af50612096d5c5a06eb6677fcf0067c Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Fri, 31 May 2019 20:24:37 +0530 Subject: [PATCH 39/42] added \n instead of line breaks --- pandas/core/base.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 66774895c8f13..ca9fc85a4afba 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -634,10 +634,7 @@ def _is_builtin_func(self, arg): class IndexOpsMixin: - """ - Common ops mixin to support a unified interface / docs for Series / - Index - """ + """\nCommon ops mixin to support a unified interface / docs for Series / Index\n""" # ndarray compatibility __array_priority__ = 1000 @@ -653,10 +650,8 @@ def transpose(self, *args, **kwargs): nv.validate_transpose(args, kwargs) return self - T = property(transpose, doc=""" - Return the transpose, which is by - definition self. - """) + T = property(transpose, doc="""\nReturn the transpose, which is by + definition self.\n""") @property def _is_homogeneous_type(self): From 42347039aa456053cb9fdba781521b746ed6e171 Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Fri, 31 May 2019 20:30:44 +0530 Subject: [PATCH 40/42] updating line breaks with \n --- pandas/core/indexes/multi.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index cba2b838b6a75..1233d035ef6df 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1077,9 +1077,7 @@ def _set_names(self, names, level=None, validate=True): self.levels[l].rename(name, inplace=True) names = property(fset=_set_names, fget=_get_names, - doc=""" - Names of levels in MultiIndex - """) + doc="""\nNames of levels in MultiIndex\n""") @Appender(_index_shared_docs['_get_grouper_for_level']) def _get_grouper_for_level(self, mapper, level): From 2a81152ed73cf834be9e8222d40e402a7e1d0e5f Mon Sep 17 00:00:00 2001 From: killerontherun1 Date: Sat, 15 Jun 2019 03:53:51 +0530 Subject: [PATCH 41/42] update to resolve --- pandas/core/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 213ee3f1c853e..ab9d8b9d778e5 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -638,7 +638,9 @@ def _is_builtin_func(self, arg): class IndexOpsMixin: - """\nCommon ops mixin to support a unified interface / docs for Series / Index\n""" + """ + Common ops mixin to support a unified interface / docs for Series / Index + """ # ndarray compatibility __array_priority__ = 1000 From fe41a8aa2affc5b9bead0c41d6946edbe23a7baa Mon Sep 17 00:00:00 2001 From: Mathew George Date: Wed, 19 Jun 2019 23:11:53 +0530 Subject: [PATCH 42/42] solving line break issue for to_tuples in pandas.arrays.InervalArray --- pandas/core/arrays/interval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index ed79da270adc9..71f4cbae7c58d 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1001,8 +1001,8 @@ def __array__(self, dtype=None): Returns ------- tuples: %(return_type)s - %(examples)s - """ + %(examples)s\ + """ @Appender(_interval_shared_docs['to_tuples'] % dict( return_type='ndarray',