mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-27 18:57:55 +00:00
8dd2d88740
* chore(Linter): reformatted code with black * Create black.yaml
13 lines
323 B
Python
13 lines
323 B
Python
from hashlib import sha256
|
|
import pandas as pd
|
|
|
|
|
|
def hash_df(df: pd.DataFrame) -> str:
|
|
s = str(df.columns) + str(df.index) + str(df.values)
|
|
return sha256(s.encode()).hexdigest()
|
|
|
|
|
|
def hash_series(df: pd.Series) -> str:
|
|
s = str(df.name) + str(df.index) + str(df.values)
|
|
return sha256(s.encode()).hexdigest()
|