Skip to content

Commit 7a711f9

Browse files
committed
remove DatetimeTZBlock.shift
1 parent 72fe4fc commit 7a711f9

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

pandas/core/internals/blocks.py

-26
Original file line numberDiff line numberDiff line change
@@ -3095,32 +3095,6 @@ def _try_coerce_result(self, result):
30953095
def _box_func(self):
30963096
return lambda x: tslibs.Timestamp(x, tz=self.dtype.tz)
30973097

3098-
def shift(self, periods, axis=0, fill_value=None):
3099-
""" shift the block by periods """
3100-
3101-
# think about moving this to the DatetimeIndex. This is a non-freq
3102-
# (number of periods) shift ###
3103-
3104-
N = len(self)
3105-
indexer = np.zeros(N, dtype=int)
3106-
if periods > 0:
3107-
indexer[periods:] = np.arange(N - periods)
3108-
else:
3109-
indexer[:periods] = np.arange(-periods, N)
3110-
3111-
new_values = self.values.asi8.take(indexer)
3112-
3113-
if isna(fill_value):
3114-
fill_value = tslibs.iNaT
3115-
if periods > 0:
3116-
new_values[:periods] = fill_value
3117-
else:
3118-
new_values[periods:] = fill_value
3119-
3120-
new_values = self.values._shallow_copy(new_values)
3121-
return [self.make_block_same_class(new_values,
3122-
placement=self.mgr_locs)]
3123-
31243098
def diff(self, n, axis=0):
31253099
"""1st discrete difference
31263100

0 commit comments

Comments
 (0)