flatbread 0.1.4__tar.gz → 0.1.5__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.
- {flatbread-0.1.4 → flatbread-0.1.5}/PKG-INFO +1 -1
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/agg/aggregation.py +7 -9
- {flatbread-0.1.4 → flatbread-0.1.5}/pyproject.toml +1 -1
- {flatbread-0.1.4 → flatbread-0.1.5}/.gitignore +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/environment.yml +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/__init__.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/accessors/dataframe.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/accessors/index.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/accessors/series.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/agg/totals.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/chaining.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/config/config.defaults.json +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/config.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/percentages.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/render/config.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/render/constants.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/render/display.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/render/tablespec.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/render/template.jinja.html +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/render/template.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/testing/dataframe.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/flatbread/tooling.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/license.md +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/readme.md +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/tests/__init__.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/tests/aggregate/__init__.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/tests/aggregate/test_percentages.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/tests/aggregate/test_totals.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/tests/test_axes.py +0 -0
- {flatbread-0.1.4 → flatbread-0.1.5}/tests/test_levels.py +0 -0
|
@@ -203,18 +203,16 @@ def _subagg_implementation(
|
|
|
203
203
|
# create key
|
|
204
204
|
levels = (levels,) if pd.api.types.is_scalar(levels) else levels
|
|
205
205
|
|
|
206
|
-
#
|
|
207
|
-
|
|
206
|
+
# Get the actual level value to include in the label
|
|
207
|
+
level_value = levels[-1] if isinstance(levels, tuple) else levels
|
|
208
|
+
|
|
209
|
+
# Create the subtotal label with the level value if requested
|
|
210
|
+
subtotal_label = label
|
|
208
211
|
if include_level_name:
|
|
209
|
-
|
|
210
|
-
if isinstance(level, (int, str)):
|
|
211
|
-
level_name = names[level] if isinstance(level, int) else level
|
|
212
|
-
current_label = f"{label} {level_name}"
|
|
213
|
-
elif isinstance(levels[-1], str):
|
|
214
|
-
current_label = f"{label} {levels[-1]}"
|
|
212
|
+
subtotal_label = f"{label} {level_value}"
|
|
215
213
|
|
|
216
214
|
padding = [_fill] * (len(names) - len(levels) - 1)
|
|
217
|
-
key = list(levels) + [
|
|
215
|
+
key = list(levels) + [subtotal_label] + padding
|
|
218
216
|
|
|
219
217
|
# ignore totals and subtotal rows when aggregating
|
|
220
218
|
rows = chaining.get_data_mask(group.index, ignore_keys)
|
|
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
|