code: def to_basis(self, basis=None,
                   start=None,
                   stop=None,
                   step=None,
                   undefined=None):
          
          if basis is None:
              if start is None:
                  new_start = self.start
              else:
                  new_start = start
              new_step = step or self.step
              new_stop = stop or self.stop
              # new_adj_stop = new_stop + new_step/100  # To guarantee inclusion.
              # basis = np.arange(new_start, new_adj_stop, new_step)
              steps = 1 + (new_stop - new_start) / new_step
              basis = np.linspace(new_start, new_stop, int(steps), endpoint=True)
          else:
              new_start = basis[0]
              new_step = basis[1] - basis[0]
  
          if undefined is None:
              undefined = np.nan
          else:
              undefined = undefined
  
          interp = interp1d(self.basis, self,
                            bounds_error=False,
                            fill_value=undefined)
  
          data = interp(basis)
  
          params = self.__dict__.copy()
          params['step'] = float(new_step)
          params['start'] = float(new_start)
  
          return Curve(data, params=params)
docs: Make a new curve in a new basis, given a basis, or a new start, step,
          and/or stop. You only need to set the parameters you want to change.
          If the new extents go beyond the current extents, the curve is padded
          with the ``undefined`` parameter.
  
          Args:
              basis (ndarray)
              start (float)
              stop (float)
              step (float)
              undefined (float)
  
          Returns:
              Curve. The current instance in the new basis.