def _preprocess_for_cut(x):
 x_is_series = isinstance(x, Series)
 series_index = None
 name = None
 if x_is_series:
  series_index = x.index
  name = x.name
 x = np.asarray(x)
 return (x_is_series, series_index, name, x)

def _preprocess_for_cut ( x ) : x_is_series = isinstance ( x , Series ) series_index = None name = None if x_is_series : series_index = x . index name = x . name x = np . asarray ( x ) return ( x_is_series , series_index , name , x )
handles preprocessing for cut where we convert passed input to array .