code: def _astype(self, dtype):
          
          kwargs = {}
          if is_floating_dtype(dtype):
              # Use weighting only for floating-point types, otherwise, e.g.,
              # `space.astype(bool)` would fail
              weighting = getattr(self, 'weighting', None)
              if weighting is not None:
                  kwargs['weighting'] = weighting
  
          return type(self)(self.shape, dtype=dtype, **kwargs)
docs: Internal helper for `astype`.
  
          Subclasses with differing init parameters should overload this
          method.