code: def _reconstruct_data(values, dtype, original):
      
      from pandas import Index
      if is_extension_array_dtype(dtype):
          values = dtype.construct_array_type()._from_sequence(values)
      elif is_datetime64tz_dtype(dtype) or is_period_dtype(dtype):
          values = Index(original)._shallow_copy(values, name=None)
      elif is_bool_dtype(dtype):
          values = values.astype(dtype)
  
          # we only support object dtypes bool Index
          if isinstance(original, Index):
              values = values.astype(object)
      elif dtype is not None:
          values = values.astype(dtype)
  
      return values
docs: reverse of _ensure_data
  
      Parameters
      ----------
      values : ndarray
      dtype : pandas_dtype
      original : ndarray-like
  
      Returns
      -------
      Index for extension types, otherwise ndarray casted to dtype