Fixed sort
This commit is contained in:
@@ -433,22 +433,9 @@ def menu_prepare_to_enforce():
|
|||||||
|
|
||||||
allowbyhash.to_parquet(f"parquet\\final_hash_approvals_{first_policy}_{second_policy}.parquet", index=False)
|
allowbyhash.to_parquet(f"parquet\\final_hash_approvals_{first_policy}_{second_policy}.parquet", index=False)
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
allowbyhash.sort_values(by=["filename"])
|
allowbyhash.sort_values(by=["filename"])
|
||||||
|
|
||||||
ct.style_dataframe_dark(allowbyhash, f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.html")
|
ct.style_dataframe_dark(allowbyhash, f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.html")
|
||||||
=======
|
|
||||||
easyview = allowbyhash.groupby('sha256').agg(list).reset_index()
|
|
||||||
# Deduplicate and sort by first item in list
|
|
||||||
for col in easyview.columns:
|
|
||||||
if col != 'sha256':
|
|
||||||
easyview[col] = easyview[col].apply(lambda x: list(set(x)))
|
|
||||||
if col in ["reputation_status", "filename"]:
|
|
||||||
# Sort the list to ensure consistent first item
|
|
||||||
easyview[col] = easyview[col].apply(lambda x: sorted(x)[0] if x else None)
|
|
||||||
|
|
||||||
ct.style_dataframe_dark(easyview, f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.html")
|
|
||||||
>>>>>>> 3f2717d972d811b0615f9b250aeb5191b255aa47
|
|
||||||
ct.style_dataframe_dark(pathexclusions, f"preflight\\final_path_exclusions_{first_policy}_{second_policy}.html")
|
ct.style_dataframe_dark(pathexclusions, f"preflight\\final_path_exclusions_{first_policy}_{second_policy}.html")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user