Implement Pearson correlation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user