code: def find_edges(a):
      
      edges = a[1:] == a[:-1]
      tops = np.where(~edges)[0] + 1
      tops = np.append(0, tops)
      values = a[tops]
  
      return tops, values
docs: Return two arrays: one of the changes, and one of the values.
  
      Returns:
          tuple: Two ndarrays, tops and values.