dshield-parser 0.1.5__tar.gz → 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/PKG-INFO +1 -1
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/json.py +11 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser.egg-info/PKG-INFO +1 -1
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/setup.py +1 -1
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/README.md +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/__init__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/__main__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/cowrie_processor/__init__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/cowrie_processor/__main__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/cowrie_processor/reports.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/firewall_processor/__init__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/firewall_processor/__main__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/firewall_processor/reports.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/test/__init__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/test/test_json.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/__init__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/__main__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/enrichment.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/file_io.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/graphs.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/ml.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/sql.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/utils/ssh.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/web_processor/__init__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/web_processor/__main__.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser/web_processor/reports.py +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser.egg-info/SOURCES.txt +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser.egg-info/dependency_links.txt +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/dshield_parser.egg-info/top_level.txt +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/pyproject.toml +0 -0
- {dshield_parser-0.1.5 → dshield_parser-0.1.6}/setup.cfg +0 -0
|
@@ -22,8 +22,19 @@ def _groupby_size(df):
|
|
|
22
22
|
In pandas 3.0, 'size' became a reserved GroupBy method name and can no longer
|
|
23
23
|
be used as a column selector after groupby(). This helper renames the column
|
|
24
24
|
temporarily to avoid the conflict.
|
|
25
|
+
Handles edge cases where df is empty or does not yet have a 'size' column.
|
|
25
26
|
"""
|
|
27
|
+
if df.empty:
|
|
28
|
+
return df
|
|
29
|
+
if 'size' not in df.columns:
|
|
30
|
+
# No size column yet — just do a count groupby and name it 'size'
|
|
31
|
+
group_cols = df.columns.tolist()
|
|
32
|
+
result = df.groupby(group_cols, as_index=False, dropna=False).size()
|
|
33
|
+
return result
|
|
26
34
|
group_cols = df.columns.difference(['size']).tolist()
|
|
35
|
+
if not group_cols:
|
|
36
|
+
# Only column is 'size', nothing meaningful to group by
|
|
37
|
+
return df
|
|
27
38
|
result = df.rename(columns={'size': '_count'})
|
|
28
39
|
result = result.groupby(result.columns.difference(['_count']).tolist(), as_index=False, dropna=False)['_count'].sum()
|
|
29
40
|
result = result.rename(columns={'_count': 'size'})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|