From d10f0aef5fdeac547c17c1a0b997c489073b6f9c Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Fri, 10 Apr 2020 22:32:47 +0300 Subject: [PATCH 1/2] CLN: Nitpicks --- pandas/_libs/reshape.pyx | 2 +- pandas/core/indexing.py | 7 +++---- pandas/core/internals/managers.py | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pandas/_libs/reshape.pyx b/pandas/_libs/reshape.pyx index e74b5919a4590..aed5e1d612088 100644 --- a/pandas/_libs/reshape.pyx +++ b/pandas/_libs/reshape.pyx @@ -36,7 +36,7 @@ ctypedef fused reshape_t: @cython.wraparound(False) @cython.boundscheck(False) -def unstack(reshape_t[:, :] values, uint8_t[:] mask, +def unstack(reshape_t[:, :] values, const uint8_t[:] mask, Py_ssize_t stride, Py_ssize_t length, Py_ssize_t width, reshape_t[:, :] new_values, uint8_t[:, :] new_mask): """ diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 22a44d65a947a..b74399ed86fbd 100644 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -827,7 +827,7 @@ def _getitem_nested_tuple(self, tup: Tuple): # this is iterative obj = self.obj axis = 0 - for i, key in enumerate(tup): + for key in tup: if com.is_null_slice(key): axis += 1 @@ -1420,7 +1420,7 @@ def _is_scalar_access(self, key: Tuple) -> bool: if len(key) != self.ndim: return False - for i, k in enumerate(key): + for k in key: if not is_integer(k): return False @@ -2234,8 +2234,7 @@ def is_nested_tuple(tup, labels) -> bool: if not isinstance(tup, tuple): return False - for i, k in enumerate(tup): - + for k in tup: if is_list_like(k) or isinstance(k, slice): return isinstance(labels, ABCMultiIndex) diff --git a/pandas/core/internals/managers.py b/pandas/core/internals/managers.py index b8f45523106b3..385a417343ad4 100644 --- a/pandas/core/internals/managers.py +++ b/pandas/core/internals/managers.py @@ -48,8 +48,6 @@ make_block, ) -from pandas.io.formats.printing import pprint_thing - # TODO: flexible with index=None and/or items=None T = TypeVar("T", bound="BlockManager") @@ -325,7 +323,7 @@ def __repr__(self) -> str: output += f"\nAxis {i}: {ax}" for block in self.blocks: - output += f"\n{pprint_thing(block)}" + output += f"\n{block}" return output def _verify_integrity(self) -> None: From 58d8d5eef7e87095709c984a80791ccd2a324bbc Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Fri, 10 Apr 2020 22:39:13 +0300 Subject: [PATCH 2/2] Restarting CI as it failed to fetch a URL