rankFD for Python
This repository contains a pure Python implementation of the independent
one-way calculation in R package rankFD 0.1.1. It estimates weighted or
unweighted nonparametric relative effects and provides the Wald-type and
ANOVA-type global tests.
Installation
Install the latest release from PyPI:
python3 -m pip install rankFD
To install the current development version directly from GitHub:
python3 -m pip install "git+https://github.com/okumuralab/rankFD.git"
To install an editable copy for development:
git clone https://github.com/okumuralab/rankFD.git
cd rankFD
python3 -m pip install -e .
Python 3.10 or newer is required. NumPy and SciPy are installed automatically as dependencies.
Usage
from rankfd import rankFD
x = [1, 2, 3, 4, 5]
y = [2, 3, 4, 5, 6]
z = [7, 8, 8, 9, 10]
result = rankFD(x, y, z)
print(result) # SciPy-style concise result
print(result.statistic) # ANOVA-type statistic
print(result.pvalue) # ANOVA-type p-value
print(result.wald)
print(result.anova)
print(result.relative_effects)
print(result.confidence_interval)
groups = [x, y, z]
same_result = rankFD(*groups)
The R defaults are preserved:
effect="unweighted"uses pseudo-ranks.hypothesis="H0F"tests equality of distribution functions.ci_method="logit"computes range-preserving pointwise intervals.
For the more general null hypothesis stated in relative effects, use
hypothesis="H0p". For classical global ranks and sample-size-weighted
effects, use effect="weighted".
With effect="weighted" and hypothesis="H0F", the nested
result.kruskal agrees with SciPy's tie-corrected Kruskal-Wallis test.
With the R default effect="unweighted", rankFD applies its pseudo-rank
version instead, which can differ in unbalanced designs.
RankFDResult.statistic and .pvalue refer to the ANOVA-type test, which is
the small-sample global procedure recommended by the rankFD methodology.
The full results are in .anova and .wald. The returned object can also be
unpacked as statistic, pvalue = rankFD(...).
Scope
The API intentionally follows SciPy's independent-sample style:
rankFD(*groups). Inputs are one-dimensional numeric arrays. NaNs can be
handled with nan_policy="propagate", "omit", or "raise".
This port implements the one-factor calculation. It does not parse R formulas, construct crossed multi-factor designs, perform multiple contrast procedures, or create plots.
Tests
Run the Python tests with:
python3 -m unittest discover -s tests -v
The cross-language suite invokes the installed R rankFD package as an oracle
and is skipped automatically when R or the R package is unavailable.
References
Edgar Brunner, Frank Konietschke, Markus Pauly, and Madan L. Puri (2016). “Rank-Based Procedures in Factorial Designs: Hypotheses About Non-Parametric Treatment Effects.” https://doi.org/10.1111/rssb.12222
Edgar Brunner, Frank Konietschke, Arne C. Bathke, and Markus Pauly (2018). “Ranks and Pseudo-Ranks - Paradoxical Results of Rank Tests -.” https://arxiv.org/abs/1802.05650
Georg Zimmermann, Edgar Brunner, Werner Brannath, Martin Happ, and Arne C. Bathke (2021). “Pseudo-Ranks: The Better Way of Ranking?” https://doi.org/10.1080/00031305.2021.1972836
rankFD: Rank-Based Tests for General Factorial Designs.
https://cran.r-project.org/package=rankFD
Release files for rankFD 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rankfd-0.1.0.tar.gz | 23.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rankfd-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.3 kB
Release files / rankfd-0.1.0.tar.gz
| Download URL | rankfd-0.1.0.tar.gz |
|---|---|
| Size | 23.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13ca966f1c6e922ddf42fa7600a8cd58b17446c5a32e05f6fc352ee5d8dd4235
|
|
BLAKE2b-256 checksum How to use checksums |
b5845df1a6782d775cf6029465389305349b9fb773ee1fded4d07f78214b63fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency logRelease files / rankfd-0.1.0-py3-none-any.whl
| Download URL | rankfd-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7936d1c0e548e1b31cd956e97debf114afea10476a1867b8c312731acb093ccf
|
|
BLAKE2b-256 checksum How to use checksums |
8e09c00a5a38db875c5d74f2181855106c0bc4e51beefb077fa891ce03d835f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency log