此時(shí)有個(gè)應(yīng)用場(chǎng)景:
有一張有很多欄位的表,需要根據(jù)每一行的所有值,去生成一個(gè)hash value作為唯一的主鍵。
df.values.tolist()得到每一行的資料(list)
import hashlib
InsertValues = str(tuple(_list))
hash_obj = hashlib.md5(InsertValues.encode('utf-8')).hexdigest()
完成

蟹蟹
此時(shí)有個(gè)應(yīng)用場(chǎng)景:
有一張有很多欄位的表,需要根據(jù)每一行的所有值,去生成一個(gè)hash value作為唯一的主鍵。
df.values.tolist()得到每一行的資料(list)
import hashlib
InsertValues = str(tuple(_list))
hash_obj = hashlib.md5(InsertValues.encode('utf-8')).hexdigest()
完成