Skip to content

Commit

Permalink
removed usage of common.get_indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Jun 23, 2011
1 parent 4e86748 commit 5849daf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
9 changes: 0 additions & 9 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ def _unpickle_array(bytes):
arr = read_array(StringIO(bytes))
return arr

def get_indexer(source, target, fill_method):
if fill_method:
fill_method = fill_method.upper()

indexer, mask = tseries.getFillVec(source, target, source.indexMap,
target.indexMap, fill_method)

return indexer, mask

def null_out_axis(arr, mask, axis):
if axis == 0:
arr[mask] = np.NaN
Expand Down
8 changes: 3 additions & 5 deletions pandas/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def transform(self, applyfunc):
group.groupName = name
res = applyfunc(group)

indexer, _ = common.get_indexer(self.obj.index, group.index, None)
indexer, _ = self.obj.index.get_indexer(group.index)
np.put(result, indexer, res)

return result
Expand Down Expand Up @@ -347,12 +347,10 @@ def transform(self, func):

if self.axis == 0:
subframe = self.obj.reindex(group)
indexer, _ = common.get_indexer(self.obj.index,
subframe.index, None)
indexer, _ = self.obj.index.get_indexer(subframe.index)
else:
subframe = self.obj.reindex(columns=group)
indexer, _ = common.get_indexer(self.obj.columns,
subframe.columns, None)
indexer, _ = self.obj.columns.get_indexer(subframe.columns)
subframe.groupName = val

try:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def _reindex_axis(self, new_index, fill_method, axis):
return self.copy()

new_index = _ensure_index(new_index)
indexer, mask = common.get_indexer(old_index, new_index, fill_method)
indexer, mask = old_index.get_indexer(new_index, fill_method)

new_values = self.values.take(indexer, axis=axis)
if len(new_index) > 0:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def _reindex_index(self, index, method):
if len(self.index) == 0:
return SparseDataFrame(index=index, columns=self.columns)

indexer, mask = common.get_indexer(self.index, index, method)
indexer, mask = self.index.get_indexer(index, method)
notmask = -mask
need_mask = notmask.any()

Expand Down

0 comments on commit 5849daf

Please sign in to comment.