def percentileRank(frame, column=None, kind='mean'):
 fun = (lambda xs, score: percentileofscore(remove_na(xs), score, kind=kind))
 results = {}
 framet = frame.T
 if (column is not None):
  if isinstance(column, Series):
   for (date, xs) in compat.iteritems(frame.T):
    results[date] = fun(xs, column.get(date, NaN))
  else:
   for (date, xs) in compat.iteritems(frame.T):
    results[date] = fun(xs, xs[column])
  results = Series(results)
 else:
  for column in frame.columns:
   for (date, xs) in compat.iteritems(framet):
    results.setdefault(date, {})[column] = fun(xs, xs[column])
  results = DataFrame(results).T
 return results

def percentileRank ( frame , column = None , kind = 'mean' ) : fun = ( lambda xs , score : percentileofscore ( remove_na ( xs ) , score , kind = kind ) ) results = { } framet = frame . T if ( column is not None ) : if isinstance ( column , Series ) : for ( date , xs ) in compat . iteritems ( frame . T ) : results [ date ] = fun ( xs , column . get ( date , NaN ) ) else : for ( date , xs ) in compat . iteritems ( frame . T ) : results [ date ] = fun ( xs , xs [ column ] ) results = Series ( results ) else : for column in frame . columns : for ( date , xs ) in compat . iteritems ( framet ) : results . setdefault ( date , { } ) [ column ] = fun ( xs , xs [ column ] ) results = DataFrame ( results ) . T return results
return score at percentile for each point in time parameters frame: dataframe column: string or series .