Skip to content

Commit

Permalink
Fix 32 bits int to 64
Browse files Browse the repository at this point in the history
  • Loading branch information
eldraco committed Aug 6, 2024
1 parent b45c816 commit a3bfcb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zeek_anomaly_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ def detect(file, amountanom, dumptocsv):
# Finally put a type to each column
bro_df.replace({'orig_bytes': '-'}, '0', inplace=True)
bro_df['orig_bytes'] = pd.to_numeric(bro_df['orig_bytes'], errors='coerce')
bro_df['orig_bytes'] = bro_df['orig_bytes'].fillna(0).astype('int32')
bro_df['orig_bytes'] = bro_df['orig_bytes'].fillna(0).astype('int64')

bro_df.replace({'resp_bytes': '-'}, '0', inplace=True)
bro_df['resp_bytes'] = pd.to_numeric(bro_df['resp_bytes'], errors='coerce')
bro_df['resp_bytes'] = bro_df['resp_bytes'].fillna(0).astype('int32')
bro_df['resp_bytes'] = bro_df['resp_bytes'].fillna(0).astype('int64')

bro_df.replace({'resp_pkts': '-'}, '0', inplace=True)
bro_df['resp_pkts'] = pd.to_numeric(bro_df['resp_pkts'], errors='coerce')
bro_df['resp_pkts'] = bro_df['resp_pkts'].fillna(0).astype('int32')
bro_df['resp_pkts'] = bro_df['resp_pkts'].fillna(0).astype('int64')

bro_df.replace({'orig_ip_bytes': '-'}, '0', inplace=True)
bro_df['orig_ip_bytes'] = pd.to_numeric(bro_df['orig_ip_bytes'], errors='coerce')
bro_df['orig_ip_bytes'] = bro_df['orig_ip_bytes'].fillna(0).astype('int32')
bro_df['orig_ip_bytes'] = bro_df['orig_ip_bytes'].fillna(0).astype('int64')

bro_df.replace({'resp_ip_bytes': '-'}, '0', inplace=True)
bro_df['resp_ip_bytes'] = pd.to_numeric(bro_df['resp_ip_bytes'], errors='coerce')
bro_df['resp_ip_bytes'] = bro_df['resp_ip_bytes'].fillna(0).astype('int32')
bro_df['resp_ip_bytes'] = bro_df['resp_ip_bytes'].fillna(0).astype('int64')

bro_df.replace({'duration': '-'}, '0', inplace=True)
bro_df['duration'] = pd.to_numeric(bro_df['duration'], errors='coerce')
Expand Down

0 comments on commit a3bfcb9

Please sign in to comment.