apmtools 0.2.31__tar.gz → 0.2.32__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.
- {apmtools-0.2.31 → apmtools-0.2.32}/PKG-INFO +1 -1
- {apmtools-0.2.31 → apmtools-0.2.32}/pyproject.toml +1 -1
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/classes.py +21 -4
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/shiny/summary.py +912 -713
- {apmtools-0.2.31 → apmtools-0.2.32}/.gitignore +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/LICENSE +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/README.md +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/__init__.py +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/data_processing.py +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/functions.py +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/legacy.py +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/shiny/__init__.py +0 -0
- {apmtools-0.2.31 → apmtools-0.2.32}/src/apmtools/units.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: apmtools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.32
|
|
4
4
|
Summary: A collection of tools for processing air pollution monitoring data
|
|
5
5
|
Project-URL: Homepage, https://github.com/federlorenz/apmtools
|
|
6
6
|
Author-email: Federico Lorenzetti <lorenzetti.federico@gmail.com>
|
|
@@ -1454,9 +1454,26 @@ class Summary(pd.DataFrame):
|
|
|
1454
1454
|
else:
|
|
1455
1455
|
output = df
|
|
1456
1456
|
|
|
1457
|
-
|
|
1457
|
+
if isinstance(frequency, str) and aggregate is None:
|
|
1458
|
+
if grouping_by != None:
|
|
1459
|
+
output = df[grouping_by+[frequency]]
|
|
1460
|
+
else:
|
|
1461
|
+
output = df[[frequency]]
|
|
1462
|
+
if isinstance(frequency, list) and aggregate is None:
|
|
1463
|
+
if grouping_by != None:
|
|
1464
|
+
output = df[grouping_by+frequency]
|
|
1465
|
+
else:
|
|
1466
|
+
output = df[frequency]
|
|
1467
|
+
if frequency == None and aggregate is None:
|
|
1468
|
+
if grouping_by != None:
|
|
1469
|
+
output = df[grouping_by]
|
|
1470
|
+
else:
|
|
1471
|
+
output = df
|
|
1472
|
+
|
|
1473
|
+
if aggregate is not None:
|
|
1474
|
+
output = output[value_cols].agg(aggregate)
|
|
1458
1475
|
|
|
1459
|
-
if frequency != None or grouping_by != None:
|
|
1476
|
+
if aggregate != None and (frequency != None or grouping_by != None):
|
|
1460
1477
|
output.columns = [
|
|
1461
1478
|
"_".join(str(x) for x in col if pd.notna(x) and x != "")
|
|
1462
1479
|
for col in output.columns.to_flat_index()
|
|
@@ -1472,8 +1489,8 @@ class Summary(pd.DataFrame):
|
|
|
1472
1489
|
output.m["aggregate"] = aggregate
|
|
1473
1490
|
|
|
1474
1491
|
return output
|
|
1475
|
-
|
|
1476
|
-
|
|
1492
|
+
|
|
1493
|
+
|
|
1477
1494
|
def get_monitor(self, value):
|
|
1478
1495
|
|
|
1479
1496
|
out = self.subset({"monitor": [value]})
|