这是我的数据帧
Student Studendid Student Studendid Student Studendid
0 Stud1 1 0 Stud1 ah274as 0 Stud1 1
1 Stud2 2 1 Stud2 ah474as 1 Stud2 2
2 Stud3 3 2 Stud3 ah454as 2 Stud3 3
3 Stud4 4 hash 3 Stud4 48sdfds hash 3 Stud4 4
4 Stud5 5 -> 4 Stud5 dash241 -> 4 Stud5 5
5 Stud6 6 5 Stud6 asda212 5 Stud6 6
6 Stud7 7 6 Stud7 askdkj2 6 Stud7 7
7 Stud8 8 7 Sud8 kadhh23 7 Stud8 8
8 Stud9 9 8 Stud9 asdhb27 8 Stud9 9
基于学生,我想散列学生ID。
我已经尝试了hash()
函数。不幸的是,我还没有找到任何方法来回溯。
我想散列,然后再散列回来。
有什么方法可以散列Studend并将其重新散列
df[Studendid] = df["Student"].hash()
就像@Ch3steR评论的那样:
注意:在Python 3.3中,字符串和字节对象的值在散列处理之前用随机值进行标记。这意味着字符串的值将被修改为一个随机值,该值在每次解释器启动时都会更改这样做是为了避免^{}
现在,打开一个新会话
但如果您只能使用几行数据:
使用helper dictionary进行散列,然后将swap} :
key:values
映射回d1
dictionary并传递到^{相关问题 更多 >
编程相关推荐