$npx skillfedfor your agent

ipfn

Iterative Proportional Fitting with N dimensions, for python

With conditionsPyPI Build ToolsReleased Dec 2021102.2K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — ipfn-1.4.4-py2.py3-none-any.whl
v1.4.4 · released 2021-12-30 · 2 runtime deps: pandas, numpy

Yes, if you need iterative proportional fitting and can tolerate dormancy. The package is stable and low-friction to install, with no known vulnerabilities and a permissive MIT license. However, expect no active maintenance—last release was 2021-12-30. Use it for well-understood IPF problems; do not expect bug fixes or updates if you encounter edge cases.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction install with only pandas and numpy as runtime dependencies.
  • Package is dormant—last release was 2021-12-30 and last commit 2024-05-10, so expect no active maintenance or bug fixes.

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use and modify freely provided you retain the license notice.

last release 2021-12-30 (1688 days) · last repo commit 2024-05-10 · 106 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 102,246 downloads/mo, #12,881 on PyPI

Verify before relying

import numpy as np
from ipfn import ipfn

m = np.array([[40, 30, 20, 10], [35, 50, 100, 75], [30, 80, 70, 120], [20, 30, 40, 50]])
xip = np.array([150, 300, 400, 150])
xpj = np.array([200, 300, 400, 100])

IPF = ipfn.ipfn(m, [xip, xpj], [[0], [1]], convergence_rate=1e-6)
m_fitted = IPF.iteration()
print(m_fitted)
  • Whether the algorithm converges reliably on all input types and dimensions, or if certain edge cases are known to fail.
  • Performance characteristics on large multidimensional arrays relative to the R ipfp package it claims equivalence with.
  • Whether dormancy means the package is stable-complete or abandoned and no longer maintained.
Same gist for agents: .md · .json

What it is and what it does

ipfn implements the iterative proportional fitting algorithm, a mathematical technique used in economics, demography, and social sciences to adjust a multidimensional contingency table so that its marginal sums (aggregates along one or more dimensions) match known target values. The package automatically selects between a fast numpy implementation and a slower but more user-friendly pandas implementation based on input type.

You provide an original array or dataframe, a list of target marginals, and the dimensions along which each marginal should apply. The algorithm iteratively rescales the table until convergence. It exposes control over iteration limits, convergence tolerance, and verbosity, returning either the fitted result, a success flag, or detailed iteration diagnostics depending on the verbosity level.

Use it for

  • Adjust population survey data to match known demographic totals across multiple geographic and age categories.
  • Rescale economic input-output tables to match independently estimated row and column sums.
  • Balance contingency tables in social science research when marginal distributions are known but cell values are uncertain.
  • Calibrate multidimensional traffic or flow models to match observed aggregate counts on subsets of dimensions.
  • Prepare synthetic microdata by adjusting initial samples to match target distributions on multiple cross-tabulated variables.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need iterative proportional fitting and can tolerate dormancy.

The package is stable and low-friction to install, with no known vulnerabilities and a permissive MIT license. However, expect no active maintenance—last release was 2021-12-30. Use it for well-understood IPF problems; do not expect bug fixes or updates if you encounter edge cases.

Install

ipfn on PyPI

Before you install

Low friction install with only pandas and numpy as runtime dependencies. Package is dormant—last release was 2021-12-30 and last commit 2024-05-10, so expect no active maintenance or bug fixes.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use and modify freely provided you retain the license notice.

Quickstart

import numpy as np
from ipfn import ipfn

m = np.array([[40, 30, 20, 10], [35, 50, 100, 75], [30, 80, 70, 120], [20, 30, 40, 50]])
xip = np.array([150, 300, 400, 150])
xpj = np.array([200, 300, 400, 100])

IPF = ipfn.ipfn(m, [xip, xpj], [[0], [1]], convergence_rate=1e-6)
m_fitted = IPF.iteration()
print(m_fitted)

Verify before relying

  • Whether the algorithm converges reliably on all input types and dimensions, or if certain edge cases are known to fail.
  • Performance characteristics on large multidimensional arrays relative to the R ipfp package it claims equivalence with.
  • Whether dormancy means the package is stable-complete or abandoned and no longer maintained.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
pandasnumpy
MaintenanceDormant 1,688 days since the last release
Last repo commit
First released
Downloads102,246 / month, #12,881 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Topic :: Software Development :: Build Tools

Evidence: ipfn-1.4.4-py2.py3-none-any.whl

Tags

Capabilities
iterative proportional fittingipf algorithm pythonadjust marginals multidimensionalraking scaling algorithmbiproportional fittingcontingency table adjustmentnumpy pandas fitting
Topics
contingency-tablesstatistical-adjustment
PyPI keywords
iterativeproportionalfittingipfpbiproportionalrasrakingscaling

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “iterative proportional fitting”

  • ipfnIterative proportional fitting algorithm that adjusts…
  • piecewise-regressionFits piecewise linear regression models to data with one or more…
  • iterative-telemetrySends anonymized telemetry data from Iterative tools, collecting…

Give your agent the search over MCP, or paste the wish link into any chat.

More Build Tools packages

packaging Worth it
PyPI · Build Tools · released Aug 2026

Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.

Apache-2.0 OR BSD-2-Clausepure Python · 3.9+
2.2Bdownloads / mo
tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
pip Worth it
PyPI · Build Tools · released Aug 2026

pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.

MITpure Python · 3.10+
617.5Mdownloads / mo
hatchling Worth it
PyPI · Python Modules · released Aug 2026

Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.

MITpure Python · 3.10+
484.2Mdownloads / mo
grpcio-tools Worth it
PyPI · Build Tools · released Jul 2026

Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.

Apache-2.0compiled wheel · 3.10+
278.2Mdownloads / mo
pre-commit Worth it
PyPI · Build Tools · released Aug 2026

pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.

Install it if your team needs consistent, automated validation at commit time.

permissive licensepure Python · 3.10+
179.9Mdownloads / mo

See also awkward-pandas · numpy-groupies · swifter · itables · Pint-Pandas · nptyping · sklearn-pandas · pandas-read-xml · piecewise-rational · datacompy