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.2.tar.gz
(1.9 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.2.tar.gz.
File metadata
- Download URL: fashiondata00-0.1.2.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8689b8c629fe1583fba17dd12d1a889039a234cc3b1aed2dffdea04c6f5d75f8
|
|
| MD5 |
349824f71bec8b23ac4b53887993557c
|
|
| BLAKE2b-256 |
9574107829b41e9fe8c4992b76a6ee8d7ebdb08f0d139307dc991e864c7dd960
|
File details
Details for the file fashiondata00-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fashiondata00-0.1.2-py3-none-any.whl
- Upload date:
- Size: 1.7 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 |
98995df84bb1a1b62b4681aad02e332918f25484bf360180cba9f4a570a81821
|
|
| MD5 |
b02176f86c35ddea0fe19172bafcc3ac
|
|
| BLAKE2b-256 |
e1f08b13acca577b183181e7fcf482e352ed60007af99d4b7584a9e1cb8fd048
|