Skip to main content

adjustpy

a simple utility python module to calculate adjusted p-values.

Introduction

I was tired to copying over the same function between python scripts so I decided to write this into a simple utilty you can install via pip.

The computation is done with my adjustp rust crate which I created to replicate the same p-value corrections done in R.

Installation

You can install this python module using pip.

pip install adjustpy

Usage

This is a single-function library which expects any dimension numpy arrays.

1 Dimensional Input

import numpy as np
from adjustpy import adjust

p_values = np.array([0.02, 0.05, 0.08, 0.11, 0.04])
q_values = adjust(p_values, method="bh")

# array([0.08333333, 0.08333333, 0.1       , 0.11      , 0.08333333])
print(q_values)

2 Dimensional Input

This works with multidimensional input as well, but will return a 1D output. This is easy to work around though as you can just reshape to your original input shape.

import numpy as np
from adjustpy import adjust

p_values = np.random.random((10, 10))
q_values_flat = adjust(p_values, method="bh")
q_values = adjust(p_values, method="bh").reshape(p_values.shape)

# (100,)
print(q_values_flat.shape)

# (10, 10)
print(q_values.shape)

Release files for adjustpy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adjustpy 0.1.1
File Size Uploaded
adjustpy-0.1.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adjustpy 0.1.1
File Interpreter ABI Platform
adjustpy-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details

Total release size: 228.7 kB

Release files / adjustpy-0.1.1.tar.gz

Download URL adjustpy-0.1.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6113d80c6b73860f9dfc6e2d2ca2d76bea74b71563a03d3e3936a71eeb9c6f5a
BLAKE2b-256 checksum
How to use checksums
a3add9dfcffe17d69b9999eb436a63a844e61ed76489d624482904e7d89f4ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.0.1

Release files / adjustpy-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL adjustpy-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Size 222.5 kB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
6bec01819dd60bcc42166aa3c4540d05631dbd3adbeb1d30d01113df33c8d4b1
BLAKE2b-256 checksum
How to use checksums
5562f832cf78c3021f7de1419aa951fb752c730999fe239e372c55466ae530fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.0.1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page