Implement Pearson correlation

This commit is contained in:
2026-07-13 21:42:16 +02:00
parent d0e70dad2a
commit 0f25c0671b
2 changed files with 142 additions and 0 deletions
+11
View File
@@ -25,3 +25,14 @@ def load_data(file_path: Path) -> pd.DataFrame:
df = pd.read_parquet(file_path)
df['Identifier'] = df.apply(extract_id, axis=1)
return df
def to_int(x):
"""Convert a hex string or integer to int, returning NaN on failure."""
if isinstance(x, (int, np.integer)):
return int(x)
if isinstance(x, str):
try:
return int(x, 16)
except ValueError:
return np.nan
return np.nan