NApy: Efficient Statistics in Python for Large-Scale Heterogeneous Data with Enhanced Support for Missing Data
Fabian Woller, Lis Arend, Christian Fuchsberger, Markus List, David B. Blumenthal
TL;DR
NApy targets the bottleneck of computing pairwise statistics on large heterogeneous datasets with missing values in Python by offering a C++ OpenMP backend with a Python wrapper and a complementary Numba path. It implements seven tests across continuous, dichotomous, and categorical features, performing on-the-fly pairwise missing-data removal and providing test statistics, $P$-values (with multiple-testing corrections), and effect sizes. Benchmark results on simulated data and the CHRIS cohort show orders-of-magnitude improvements in runtime and memory efficiency over SciPy, Pingouin, and pandas baselines, enabling real-time interactive exploration of association networks. The work provides open-source code and benchmarking data to facilitate adoption in interactive biomedical analytics and large-scale data exploration.
Abstract
Existing Python libraries and tools lack the ability to efficiently compute statistical test results for large datasets in the presence of missing values. This presents an issue as soon as constraints on runtime and memory availability become essential considerations for a particular usecase. Relevant research areas where such limitations arise include interactive tools and databases for exploratory analysis of biomedical data. To address this problem, we present the Python package NApy, which relies on a Numba and C++ backend with OpenMP parallelization to enable scalable statistical testing for mixed-type datasets in the presence of missing values. Both with respect to runtime and memory consumption, NApy outperforms competitor tools and baseline implementations with naive Python-based parallelization by orders of magnitude, thereby enabling on-the-fly analyses in interactive applications. NApy is publicly available at https://github.com/DyHealthNet/NApy.
