def shift(self, periods, axis=<NUM_LIT:0>, fill_value=None):
<EOL>new_values, fill_value = maybe_upcast(self.values, fill_value)<EOL>f_ordered = new_values.flags.f_contiguous<EOL>if f_ordered:<EOL><INDENT>new_values = new_values.T<EOL>axis = new_values.ndim - axis - <NUM_LIT:1><EOL><DEDENT>if np.prod(new_values.shape):<EOL><INDENT>new_values = np.roll(new_values, ensure_platform_int(periods),<EOL>axis=axis)<EOL><DEDENT>axis_indexer = [slice(None)] * self.ndim<EOL>if periods > <NUM_LIT:0>:<EOL><INDENT>axis_indexer[axis] = slice(None, periods)<EOL><DEDENT>else:<EOL><INDENT>axis_indexer[axis] = slice(periods, None)<EOL><DEDENT>new_values[tuple(axis_indexer)] = fill_value<EOL>if f_ordered:<EOL><INDENT>new_values = new_values.T<EOL><DEDENT>return [self.make_block(new_values)]<EOL>
shift the block by periods, possibly upcast