order=staypoint['label'].value_counts().reset_index() #统计频率
order=order.apply(lambda row: row.name, axis=1) #按出现频率从高到低赋索引值
areamap=dict(order[['index','label']].values.tolist())#生成dict
staypoint['label']=staypoint['label'].map(areamap) #赋值
order=staypoint['label'].value_counts().reset_index() #统计频率
order=order.apply(lambda row: row.name, axis=1) #按出现频率从高到低赋索引值
areamap=dict(order[['index','label']].values.tolist())#生成dict
staypoint['label']=staypoint['label'].map(areamap) #赋值