Simplify byte column selection in correlation calculation
This commit is contained in:
+1
-2
@@ -36,8 +36,7 @@ def _entropy_col(a: np.ndarray) -> float:
|
||||
return float(-np.sum(p * np.log2(p)))
|
||||
|
||||
def calculate_byte_entropy(df: pd.DataFrame) -> pd.DataFrame:
|
||||
byte_cols = [f"b{i}" for i in range(8) if f"b{i}" in df.columns]
|
||||
available_cols = byte_cols
|
||||
available_cols = [f"b{i}" for i in range(8) if f"b{i}" in df.columns]
|
||||
if not available_cols:
|
||||
raise ValueError("No byte columns (b0-b7) found in the DataFrame")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user