User Tools

Site Tools


ranker
# ranker function
def ranker(df):
    df['rank'] = np.arange(len(df)) + 1
    return df
 
# apply rank
df = df.groupby(['ip']).apply(ranker)
ranker.txt · Last modified: 2016/10/07 15:54 by vincenzo