Skip to main content

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.

PyPI version Python versions License Documentation


Features

  • Flexible input — accepts a pandas.DataFrame or 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
  • 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 bookkeepinginverse_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifcfill-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ifcfill-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

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

Hashes for ifcfill-0.1.0.tar.gz
Algorithm Hash digest
SHA256 089764954d97ea6781956995f44f166ae731e439b5f23e8935ba4fc284a2c6a7
MD5 97c2f48259bdc3def681f09e75292f25
BLAKE2b-256 4db2b10f04140b2cb22e6462046371d9667b57be9b7396e7a0c3a5dc9d3b20f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfill-0.1.0.tar.gz:

Publisher: publish.yml on EulerLettersAI/ifcfill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ifcfill-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7cafde7ae66ae017a8f52dda5f3c3db5cbaa43e874bc53b2aafd11bdb1b6794
MD5 6724ef26e20806f36327fe893f828db2
BLAKE2b-256 2377a1289acd3e2e39f8a1ce2d38907be945f33c546ddf0a3b312722cb7f6fac

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfill-0.1.0-py3-none-any.whl:

Publisher: publish.yml on EulerLettersAI/ifcfill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page