Transformer of tabular data into Integer, Float and Categorical (IFC) variables with missing data imputation.
Project description
ifcfill
ifcfill is a Python library for transforming tabular data into Integer, Float, and Categorical (IFC) variables, with fast NumPy-powered missing data imputation and full transformation tracking.
Features
- Flexible input — accepts a
pandas.DataFrameor a path to a CSV file - Automatic type inference — detects integer, float, categorical, and datetime columns automatically; user overrides supported per column
- Configurable imputation — choose fill strategy independently for each type:
- Integer:
mean,median,mode,zero - Float:
mean,median,mode,zero - Categorical:
mode,constant
- Integer:
- Datetime → integer conversion — converts date/time columns to integers relative to a configurable anchor date and time unit (days, seconds, ms, …)
- Constant column removal — automatically detects and drops columns with a single unique value
- Missing value tracking — records the count and fraction of missing values per column at fit time, accessible via
missing_report_ - Full transformation bookkeeping —
inverse_transform()restores dropped constants, original column order, and optionally re-introduces missing values at the original rate
Installation
pip install ifcfill
Quick Start
import pandas as pd
from ifcfill import IFCTransformer
df = pd.DataFrame({
"age": [25, 30, None, 40],
"salary": [50_000.5, None, 75_000.0, 90_000.25],
"city": ["London", None, "Paris", "London"],
"joined": pd.to_datetime(["2020-01-01", "2021-06-15", None, "2023-03-10"]),
"flag": ["yes", "yes", "yes", "yes"], # constant → will be dropped
})
tf = IFCTransformer(
int_fill="median",
float_fill="mean",
cat_fill="mode",
datetime_anchor="1970-01-01",
datetime_unit="D",
)
transformed = tf.fit_transform(df)
print(transformed)
# Inspect missing-value distribution captured at fit time
print(tf.missing_report_)
# Restore original structure (constants + column order + optional missing values)
restored = tf.inverse_transform(transformed, restore_missing=True, random_state=42)
print(restored)
From a CSV file
transformed = IFCTransformer().fit_transform("data.csv")
Override column types
tf = IFCTransformer(col_types={"age": "categorical", "score": "float"})
transformed = tf.fit_transform(df)
Documentation
Full documentation including the API reference is available at: https://eulerlettersai.github.io/ifcfill
License
Apache 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 ifcfill-0.1.0.tar.gz.
File metadata
- Download URL: ifcfill-0.1.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
089764954d97ea6781956995f44f166ae731e439b5f23e8935ba4fc284a2c6a7
|
|
| MD5 |
97c2f48259bdc3def681f09e75292f25
|
|
| BLAKE2b-256 |
4db2b10f04140b2cb22e6462046371d9667b57be9b7396e7a0c3a5dc9d3b20f0
|
Provenance
The following attestation bundles were made for ifcfill-0.1.0.tar.gz:
Publisher:
publish.yml on EulerLettersAI/ifcfill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifcfill-0.1.0.tar.gz -
Subject digest:
089764954d97ea6781956995f44f166ae731e439b5f23e8935ba4fc284a2c6a7 - Sigstore transparency entry: 1189064182
- Sigstore integration time:
-
Permalink:
EulerLettersAI/ifcfill@6413f6b3fb1a7abc38e184399fcee80c641d4de7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EulerLettersAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6413f6b3fb1a7abc38e184399fcee80c641d4de7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ifcfill-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ifcfill-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7cafde7ae66ae017a8f52dda5f3c3db5cbaa43e874bc53b2aafd11bdb1b6794
|
|
| MD5 |
6724ef26e20806f36327fe893f828db2
|
|
| BLAKE2b-256 |
2377a1289acd3e2e39f8a1ce2d38907be945f33c546ddf0a3b312722cb7f6fac
|
Provenance
The following attestation bundles were made for ifcfill-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on EulerLettersAI/ifcfill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifcfill-0.1.0-py3-none-any.whl -
Subject digest:
e7cafde7ae66ae017a8f52dda5f3c3db5cbaa43e874bc53b2aafd11bdb1b6794 - Sigstore transparency entry: 1189064183
- Sigstore integration time:
-
Permalink:
EulerLettersAI/ifcfill@6413f6b3fb1a7abc38e184399fcee80c641d4de7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EulerLettersAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6413f6b3fb1a7abc38e184399fcee80c641d4de7 -
Trigger Event:
push
-
Statement type: