def _ros_sort(df, observations, censorship, warn=False):
 censored = sort_values(df[df[censorship]], observations, axis=0)
 uncensored = sort_values(df[(~ df[censorship])], observations, axis=0)
 if (censored[observations].max() > uncensored[observations].max()):
  censored = censored[(censored[observations] <= uncensored[observations].max())]
  if warn:
   msg = 'Dropping censored observations greater than the max uncensored observation.'
   warnings.warn(msg)
 return censored.append(uncensored)[[observations, censorship]].reset_index(drop=True)

def _ros_sort ( df , observations , censorship , warn = False ) : censored = sort_values ( df [ df [ censorship ] ] , observations , axis = 0 ) uncensored = sort_values ( df [ ( ~ df [ censorship ] ) ] , observations , axis = 0 ) if ( censored [ observations ] . max ( ) > uncensored [ observations ] . max ( ) ) : censored = censored [ ( censored [ observations ] <= uncensored [ observations ] . max ( ) ) ] if warn : msg = 'Dropping censored observations greater than the max uncensored observation.' warnings . warn ( msg ) return censored . append ( uncensored ) [ [ observations , censorship ] ] . reset_index ( drop = True )
this function prepares a dataframe for ros .