From dbc59af1d78d83db5833c0e1cc07e23774036400 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Fri, 4 Aug 2017 00:06:00 -0700 Subject: [PATCH 1/2] Remove unused get methods that would raise AttributeError if called --- pandas/core/internals.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pandas/core/internals.py b/pandas/core/internals.py index 37fc1c01061ec..3786de2547f28 100644 --- a/pandas/core/internals.py +++ b/pandas/core/internals.py @@ -323,10 +323,6 @@ def reindex_axis(self, indexer, method=None, axis=1, fill_value=None, fill_value=fill_value, mask_info=mask_info) return self.make_block(new_values, fastpath=True) - def get(self, item): - loc = self.items.get_loc(item) - return self.values[loc] - def iget(self, i): return self.values[i] @@ -1658,13 +1654,6 @@ def set(self, locs, values, check=False): assert locs.tolist() == [0] self.values = values - def get(self, item): - if self.ndim == 1: - loc = self.items.get_loc(item) - return self.values[loc] - else: - return self.values - def putmask(self, mask, new, align=True, inplace=False, axis=0, transpose=False, mgr=None): """ From 51f041b4e73badfbb64c12ef8b73388310766ca5 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Fri, 4 Aug 2017 17:34:04 -0700 Subject: [PATCH 2/2] Remove unnecessary import --- pandas/core/internals.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/core/internals.py b/pandas/core/internals.py index 3786de2547f28..e62f88f47897c 100644 --- a/pandas/core/internals.py +++ b/pandas/core/internals.py @@ -4711,8 +4711,6 @@ def _concat_indexes(indexes): def _block2d_to_blocknd(values, placement, shape, labels, ref_items): """ pivot to the labels shape """ - from pandas.core.internals import make_block - panel_shape = (len(placement),) + shape # TODO: lexsort depth needs to be 2!!