code: def _update_index(self, axis, key, value):
          
          # delete current value if given None
          if value is None:
              return delattr(self, key)
  
          _key = "_{}".format(key)
          index = "{[0]}index".format(axis)
          unit = "{[0]}unit".format(axis)
  
          # convert float to Quantity
          if not isinstance(value, Quantity):
              try:
                  value = Quantity(value, getattr(self, unit))
              except TypeError:
                  value = Quantity(float(value), getattr(self, unit))
  
          # if value is changing, delete current index
          try:
              curr = getattr(self, _key)
          except AttributeError:
              delattr(self, index)
          else:
              if (
                      value is None or
                      getattr(self, key) is None or
                      not value.unit.is_equivalent(curr.unit) or
                      value != curr
              ):
                  delattr(self, index)
  
          # set new value
          setattr(self, _key, value)
          return value
docs: Update the current axis index based on a given key or value
  
          This is an internal method designed to set the origin or step for
          an index, whilst updating existing Index arrays as appropriate
  
          Examples
          --------
          >>> self._update_index("x0", 0)
          >>> self._update_index("dx", 0)
  
          To actually set an index array, use `_set_index`