Excel-style conditional aggregation with AND/OR logic for pandas
Project description
fashiondata00
fashiondata00 is a lightweight Python package that provides a single versatile function all()
for Excel-style conditional aggregation in pandas, supporting AND / OR logic.
📦 Installation
pip install fashiondata00
🧠 Function: all()
all(df, target_col=None, agg='sum', logic='and', **conditions)
Parameters:
df: pandas DataFrametarget_col: column to aggregate (optional if usingcount)agg: aggregation type -'sum','mean','count','min','max'logic:'and'(default) or'or'for combining conditions**conditions: keyword arguments specifying conditions
(e.g.,Gender='F', City='Seoul')
✅ Examples
from fashiondata00 import all
import pandas as pd
df = pd.DataFrame({
'Gender': ['F', 'M', 'F', 'F'],
'City': ['Seoul', 'Busan', 'Seoul', 'Busan'],
'Score': [90, 70, 85, 95]
})
# AND condition: Female AND lives in Seoul → sum of scores
all(df, target_col='Score', agg='sum', logic='and', Gender='F', City='Seoul')
# Output: 175
# OR condition: Female OR lives in Seoul → average score
all(df, target_col='Score', agg='mean', logic='or', Gender='F', City='Seoul')
👤 Author
Made by [Kwon Ki Yong]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fashiondata00-0.1.4.tar.gz
(2.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fashiondata00-0.1.4.tar.gz.
File metadata
- Download URL: fashiondata00-0.1.4.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f913cfd0603ab3a65b3b230bfd04a52a33fdfa687663e3b53916313848f23bc
|
|
| MD5 |
05582865b3950bd4085b0a865443cfe6
|
|
| BLAKE2b-256 |
f8b8fd631b95e8f73eb61e5fc40536aa289c6bca294e64f7afd0c354d0b9f5a2
|
File details
Details for the file fashiondata00-0.1.4-py3-none-any.whl.
File metadata
- Download URL: fashiondata00-0.1.4-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c6eea35f765d93ad5b6d3329bd1fb2dd4eeaa34858102b33200c80a747a0d4b
|
|
| MD5 |
63a0bcde16534cef41a4ea3f076543dd
|
|
| BLAKE2b-256 |
d963d61c0d3929ddec93f37d735c57a376a7dcd30d08992cac910b4fa37cc7ee
|