def index_of(y):
 try:
  return (y.index.values, y.values)
 except AttributeError:
  y = np.atleast_1d(y)
  return (np.arange(y.shape[0], dtype=float), y)

def index_of ( y ) : try : return ( y . index . values , y . values ) except AttributeError : y = np . atleast_1d ( y ) return ( np . arange ( y . shape [ 0 ] , dtype = float ) , y )
a helper function to get the index of an input to plot against if x values are not explicitly given .