code: def reshape(self, *shape):
          
          if prod(self.shape) != prod(shape):
              raise ValueError("Reshaping must leave the number of elements unchanged")
  
          if self.shape[-1] != shape[-1]:
              raise ValueError("Reshaping cannot change the size of the constituent series (last dimension)")
  
          if self.labels is not None:
              newlabels = self.labels.reshape(*shape[:-1])
          else:
              newlabels = None
  
          return self._constructor(self.values.reshape(shape), labels=newlabels).__finalize__(self, noprop=('labels',))
docs: Reshape the Series object
  
          Cannot change the last dimension.
  
          Parameters
          ----------
          shape: one or more ints
              New shape