Fast Fisher's Exact Test
Project description
Fisher's Exact Test
Simple, fast implementation of Fisher's exact test. For example, for the following table:
Having the property | Not having the property | |
---|---|---|
Selected | 12 | 5 |
Not selected | 29 | 2 |
Perhaps we are interested in whether there is any difference of property in selected vs. non-selected groups, then we can do the Fisher's exact test.
Installation
Within this folder :
git clone git://github.com/brentp/fishers_exact_test.git
pip install .
From PyPI :
pip install fisher
Or install the development version :
pip install git+git://github.com/brentp/fishers_exact_test.git
Usage
fisher.pvalue()
accepts 4 values corresponding to the 2-by-2
contingency table, returns an object with attributes for left_tail,
right_tail, and two_tail p-values :
>>> from fisher import pvalue
>>> mat = [[12, 5], [29, 2]]
>>> p = pvalue(12, 5, 29, 2)
>>> p.left_tail, p.right_tail, p.two_tail # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS
(0.04455473783507..., 0.994525206021..., 0.0802685520741...)
Benchmark
A simple benchmark that calls the Fisher's exact test 1000 times (in
scripts/rfisher.py
):
calling python fisher...
iterations/sec: 3000.62526381
calling rpy fisher...
iterations/sec: 289.225902364
calling R directly...
iterations/sec: 244.36542276
So the cython fisher is up to 10 times faster than rpy or R version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for fisher-0.1.12-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf43df9dd0b02a51cbc40ba443209b3143733cde0cf3505a8a5059ccbba64f2f |
|
MD5 | 16c7572a5f7191570797d5ab66ece4f1 |
|
BLAKE2b-256 | c794d724b2301d36b2b768c652c38196c1a745b2cbdf32930808870dda1b2bec |
Hashes for fisher-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3627f664f2a4ca997e6ca187e0b932271c43e1e9e741a4bb0d8d945e3f1d6616 |
|
MD5 | 4d7fc244496dff2ebb5d55bb53186221 |
|
BLAKE2b-256 | 58c0d3dcb86cff5a0e87e71af951a8487de37fc99e1d3037e100a4549928db3a |
Hashes for fisher-0.1.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6053060f9a34749b234792fe3e5cb0054347bdbb4ab9ec2a6921c8d2b73bdda5 |
|
MD5 | 689206fd5d5c268422325d2354b0e5f5 |
|
BLAKE2b-256 | db6409619843749f6280bff37ce49fd9a8afad054d14758625569b39139dd6f7 |
Hashes for fisher-0.1.12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faea9553e16f5db053c6870ab1d065c8b698450bcbd6c85b04404ba4a0481e27 |
|
MD5 | 8a76e8d5def0b6adb5c146f94a31c8f1 |
|
BLAKE2b-256 | 6a0bb2473205b83374187939c467dec43ae62f5fa0f55b13ce3c40a8d6879624 |
Hashes for fisher-0.1.12-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c27ab201708c57cd529d3eebe455f96031a53653977f40077dfda4fb99134fa |
|
MD5 | 010b11622147d21ae9c14c54af01c489 |
|
BLAKE2b-256 | dfbc72e7702c59e5e563d1eae67b691681990468a40c94df428b6a8c0885bc6e |
Hashes for fisher-0.1.12-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af5f01ebe2beaa8f17a4d109aa8cdfdfd8802a6affcc4699a1b2dfc1f9a92a4c |
|
MD5 | 436ac3180aaae495d355b5b6151caabe |
|
BLAKE2b-256 | 6b2ff94d3b3db6883ce1072f621534f925e05fcd7ba0a915b46e9679bd16a1c7 |
Hashes for fisher-0.1.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5d25206242a35a2f0de46549f8be9b64ee8562af1180874c376abff9c301919 |
|
MD5 | 984f6b9f204d956fc74f9f78b5df5529 |
|
BLAKE2b-256 | c819b12de23774645ae435d74ffc81be490d900b35eeb995597316f24f55d119 |
Hashes for fisher-0.1.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b2c37d90ba117f9bcf5b465c1257cb0aced56d2d9c87bb09f18d01b94df5d16 |
|
MD5 | 541e5041b531fa2bd0a65c4e757e70d6 |
|
BLAKE2b-256 | 0f1619d7e461248ef89da76c2c934eec916dad7a50c7002104be4c4c166a3397 |
Hashes for fisher-0.1.12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42a5b071bb97718a78d63c4cee30f815b3361f0ab0b9dad0f262cc8285ac5f6c |
|
MD5 | 085a71c541e5b98e5216b1207e749966 |
|
BLAKE2b-256 | ce496da73f2b598292bcae16a1f638da4a54a19475e4e6b453d0697bb9b9a60d |
Hashes for fisher-0.1.12-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b815132eb1611649d5cf60795a896163187a424a317425b70c7f045b954ff62a |
|
MD5 | d13958a61901a96187b0b99f7206a448 |
|
BLAKE2b-256 | d3659a9fad070696f0ddef7a74cf33f98d9910b57b8e0fe0a865f28cf097a252 |
Hashes for fisher-0.1.12-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63bcf6533333c015f740557dc608ff1459f990136d8e465c9d3c1ccf67e7c22 |
|
MD5 | f63cfc8b88f0d2ec0b986549a95089aa |
|
BLAKE2b-256 | fede9f5cc1255b948dc748de91861bda16bbeaec0e607812c086184f4e3be532 |
Hashes for fisher-0.1.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c315a5f7955733acffc43b1a41a8716e8e25f5437d328a05435094243194a68 |
|
MD5 | 344dca644702e8244ce06b8233d21794 |
|
BLAKE2b-256 | baadb6c472531e30accfb6ca0365da1b0847cfe7eb8d50fc214ac3411385b231 |
Hashes for fisher-0.1.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54bd7c2df9fc0ce05fcdb04f22fa47d88dd67c2dbd6b04d01c1d620b652c8d9e |
|
MD5 | a6db7c7130821341914b8822f1cee928 |
|
BLAKE2b-256 | a081a80c108f1c4414f402a80230016f0ef873918e53815a87a84395dea840d5 |
Hashes for fisher-0.1.12-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45617a9806b4154fab594a301a86abbdbabcfdf0ce3fdbc0b4277ef665bd5b5e |
|
MD5 | 41a19e9a061f20fa6d53262b48c81129 |
|
BLAKE2b-256 | 6c3d4dcddf2dc6c24e17aff552189c0c3ff22a6318444fc90d2b2537c0c3d5ec |
Hashes for fisher-0.1.12-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa3538874491aa8c70602f0313b55be399d500c8768a5bd78934f83fb77c34cb |
|
MD5 | be0bc06b8793a1c5ea8e7115442e80cd |
|
BLAKE2b-256 | b6901b82c47be2321207266594ec4b5f97b93af165e54a3d3dc94783cb440457 |
Hashes for fisher-0.1.12-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2afec3c5438b7554c3d50cdd3b6d04b3064ed45bc7ad159472ba2cf87597764d |
|
MD5 | 3fa5a751e4caf1a53c2e1709921b0db1 |
|
BLAKE2b-256 | fcdf796004d136338dc1009f6cc6671d97a5f6b871300fa05171f2b801685d46 |
Hashes for fisher-0.1.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5331c115ce225e4fcb925316c931e62e3bd0b9e443c2d1acaa653e2ae34026 |
|
MD5 | 187a7d715971badcbfc5d8d16900e798 |
|
BLAKE2b-256 | 1c8965d755c8e484090ccd058628eac4cfe9952bea4da92e6e241ff80db62346 |
Hashes for fisher-0.1.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dd8f98d73bf083d90ec2c7b980a2edd45335004282f6a0ea60f49ed62bc6c78 |
|
MD5 | ffb3449c44624191549552b5e15916b3 |
|
BLAKE2b-256 | f8753ae01bdc1f21c92c3644a5a6456c5df675646aa994a6f329eca25c9809bd |
Hashes for fisher-0.1.12-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25804f9279fb434a1f553d171731a5e82bdf1293035697108b7229b743a8e862 |
|
MD5 | a93449d33b7e39506a3e646314bd4367 |
|
BLAKE2b-256 | 34cf004ddbf32e28dd60ee012dbe99beec39c9bf924592c728b80283f5c8f274 |
Hashes for fisher-0.1.12-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58672ece0171e3aa6348455f7f8b52f320496619ae201f271c9385b92f9e4002 |
|
MD5 | 90a478188dca8b9cd44d6400f0b28b52 |
|
BLAKE2b-256 | 1650d71995c4788d06b31b18e317999314fcda5ac3db74f62cd6edc8c17156f8 |
Hashes for fisher-0.1.12-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3237538d88a8a9de7227900c93ad7034787c2ff8f8f4490537d62b0e7d39c14c |
|
MD5 | 3e845b32ceaf7e06fbe1fc409c62478c |
|
BLAKE2b-256 | 19d34516830301862b2e5a41edd3bfde1e1512e8a59f22614b2df21ff6414556 |
Hashes for fisher-0.1.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4df702ed86161fab91693f7022f7f9c7548ea8d98a6494245ea8762fe6e563c |
|
MD5 | 876085084804dff0747bc19c7763a733 |
|
BLAKE2b-256 | a4c5dc252a7036de946995ea8055164082f025300cdadbcbd81554604977a5b0 |
Hashes for fisher-0.1.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 977aa1e5ca074debd1a60a57546e0d047c252773c72db569256d0a85a91e252b |
|
MD5 | 0a84e17d9b0fc1100353d31eaf44f315 |
|
BLAKE2b-256 | cce60279b2e60d649a27ca9488f1083440faa96fd109e46d106ce65449df98d1 |
Hashes for fisher-0.1.12-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50dc8ef0773dc69cf6ddd735207e463467679e7198e9413f9b6a9ecca2fbb2f3 |
|
MD5 | d0744391ed702ab3b604fc322fda06f3 |
|
BLAKE2b-256 | a3ae77d73eac7f36b0a3e14e597a3f6febf020392380b59f05e819152055cfe6 |