Skip to main content

Fast Fisher's Exact Test

Project description

Fisher's Exact Test

Package image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fisher-0.1.14.tar.gz (22.4 kB view details)

Uploaded Source

Built Distributions

fisher-0.1.14-cp311-cp311-win_amd64.whl (81.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

fisher-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (517.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fisher-0.1.14-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (511.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

fisher-0.1.14-cp311-cp311-macosx_11_0_arm64.whl (85.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fisher-0.1.14-cp311-cp311-macosx_10_9_x86_64.whl (92.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

fisher-0.1.14-cp310-cp310-win_amd64.whl (81.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

fisher-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (478.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fisher-0.1.14-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (472.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

fisher-0.1.14-cp310-cp310-macosx_11_0_arm64.whl (85.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fisher-0.1.14-cp310-cp310-macosx_10_9_x86_64.whl (92.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

fisher-0.1.14-cp39-cp39-win_amd64.whl (81.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

fisher-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fisher-0.1.14-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (474.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

fisher-0.1.14-cp39-cp39-macosx_11_0_arm64.whl (85.9 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fisher-0.1.14-cp39-cp39-macosx_10_9_x86_64.whl (92.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

fisher-0.1.14-cp38-cp38-win_amd64.whl (81.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

fisher-0.1.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (486.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fisher-0.1.14-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (479.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

fisher-0.1.14-cp38-cp38-macosx_11_0_arm64.whl (85.3 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

fisher-0.1.14-cp38-cp38-macosx_10_9_x86_64.whl (92.2 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

fisher-0.1.14-cp37-cp37m-win_amd64.whl (81.0 kB view details)

Uploaded CPython 3.7m Windows x86-64

fisher-0.1.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (453.4 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

fisher-0.1.14-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (445.1 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

fisher-0.1.14-cp37-cp37m-macosx_10_9_x86_64.whl (92.2 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file fisher-0.1.14.tar.gz.

File metadata

  • Download URL: fisher-0.1.14.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fisher-0.1.14.tar.gz
Algorithm Hash digest
SHA256 3594e247f28be0e7716e7ff7e420583ddb2eab9e5732dc86514b1ff78c3000b9
MD5 30bb02383389a3d353cde790f900e3b3
BLAKE2b-256 df3f003a4fe3217c20dcf9d23c0c93c9b9d2c0d18344736fcb0656def8197287

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: fisher-0.1.14-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 81.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fisher-0.1.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3687af7a257c9ea6d789c9405353a1c2406425a999142af74aab8de9a67fe01f
MD5 0b5264220e59b1d93377f45f87f3debd
BLAKE2b-256 34003c86a31476a53d800796c8a60a5e20cd578c3b59690e085970bc354ad672

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 457b044ce36badc40ee5475709bab82542d94f0e15f1fc396a008102e8945375
MD5 c982ec2775d6dde8f0c3d6545e935933
BLAKE2b-256 47d6858cd67e80443e99cb1b7686ba38c0d849404a2b82879a54bec03e6349b5

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 48295fcb35a1aee67db36689ec28d2ba43da5f6fa86ea55ec0a955b0048dc15e
MD5 fee6a7bb4b364f6ba365d195d98268f5
BLAKE2b-256 d77a55762574360df85428f14f651a03fe393f0a1c1ed25881d86f8d4b5243c6

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a0c4ba4b9b58d883c487c28b1ab4053aeaf2a3674c538ec2bb8935ec794e055
MD5 a0ed8535c56552c537dea7fbb957493f
BLAKE2b-256 308226b22605abf06710c7a5c9823515e6fa98c57d54dcc63f55163e768a9672

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bbed68f1ef31848d563cfc4eef3ce427ca301939dc421cd01ae4ed2f22a53bca
MD5 988163af4641f1d3df558f34b5eedac9
BLAKE2b-256 10cc395e5d123ca23fd0f2e0af133c15f00030f3dedbb67c43834f7cda07265e

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: fisher-0.1.14-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 81.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fisher-0.1.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fc6596e623b6aab2efd143702149165a95aa893f925368bb5c5edc6ebfccb67a
MD5 109ff02bac10ef2ed36d4595877c800d
BLAKE2b-256 76a390044b8bcd4c2b7465c30d3215536f81f216cd9c56b465f578ddefb29ec7

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc12c558d5715135b117dfe33c353db6ba96ed0790e45e020936ce76043ebcbb
MD5 b9d1a11466f81a774c18b1a057ba734f
BLAKE2b-256 2566ed709d3670ecd916ed58b81c898d3da97767ace02d4984143cacaba493ea

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1fc416a6a2136f37f3f67e4967c192fa3316d6e5f403e0e78cf8a53294bcce7f
MD5 9c75878d035966d17b5633e777ef6a02
BLAKE2b-256 f2c871b3dfaca8b4ef06f09450e651f0518fe5ee71ac07aec8becf26efa60228

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eee9aa0c62381bca24356e1d426dc6b8a727d5aa481fd2e1f227fad53438eab6
MD5 9c416f99c505b42df906989ec9feb94a
BLAKE2b-256 03ccee1eecd096ed9177516e4b6ee438122f2525700644bf8c2a98ea9b5ac246

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4639a67b542d8859fdbbea4f573499d5d22eb4769128b54b86c705aaf0a7c36d
MD5 4fc3ff0a9874bcf3bdf16700d6be3d28
BLAKE2b-256 3d6905cf6a9e786dfaa0d9435770269bb85a85d26b1b16dd3ec312aa20de8828

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fisher-0.1.14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 81.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fisher-0.1.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bd37dc3aab51fe4dbbfdde482af7d67cbda442a70930d0426f982c4f9dc48582
MD5 76dfd68ec4128c7e593c273e62f53f5c
BLAKE2b-256 43015782f70dd0396de142a089ffe512a94c1b7026f69e80f93d642fb9c8eac4

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba0fb2a7fd9e3d078449b16bd57b8c0c5bc7de331c9b3f322f8f5aeddaea88a5
MD5 3bf6325b218f2d930f1a1e82d71a1dd9
BLAKE2b-256 aaab1597540637afd26b83507e611757168bc7697894615ac9497212d7a6fac9

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9fbd3c6fb2372eb2335a7bcebdb3179ee480e4c64b34df02808c57bf4481ab16
MD5 5acea22e4e203c74a524c9613c0cb20b
BLAKE2b-256 71197428cf5db04f2748f422fa2b891db24caa5368d78ed256c2900f6decac10

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5faf2704e5cd5a1e2245ad5540c732e70d34f28349b8066877b8c8eeca136c1e
MD5 35cac5bc7525495271ed487e68c9749c
BLAKE2b-256 b1275d917a781acb005158c8c3414222a9bd4ba6afda19295221528806b8fd28

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 095700e4121617304e0fb3a145fef9bbc0f60ead047fa0c29282fa88e196f384
MD5 539c45154bea5cd3cc328cd1015d7e82
BLAKE2b-256 c5dc5b54aadd4c58828e490299f282cb29c9b0d096454e269c0d2e5c84fbd162

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fisher-0.1.14-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 81.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fisher-0.1.14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 da7a25ed2a2a54fe8a1140add2e288119be27cf3868ed6c5ff90b411db786c1a
MD5 adf12245378517df3e0358d2f5c628ab
BLAKE2b-256 e469bbc2d89907a5c44ea1eac426815a71e9d599f29e9e0df31be2b2a6569f4a

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d34c78648961b0bb127166f845a038e602816eff4200895142a49e337c9a4203
MD5 f4cb21bb5db1b4b3f7384dfe92c8d7bd
BLAKE2b-256 5e33b67e56ad4aff7255fc5fb3a8f614e069ade8bf06ae7a279acd4d1329c2ea

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1fc2a4083ba3010d1643f31ddba03723a3c718df03fab07efd780d0e1693b867
MD5 d3c35650b835fc8a5f16772f99d56590
BLAKE2b-256 4f63a0fa61f6cdca6c8159b448790d428892f7363b2ba9db0f92688c1644b429

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80e3a50117e9a48a47a66cc890692ebdad70acdadc3ea6496bcff31dca9788a6
MD5 43ff630787424a0070bcc26e047cc7d9
BLAKE2b-256 4ea99492759f5c69636194861863d160416c31e560b6bc35dd15667584cc9a0d

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fa05cdea746cb93e64c20d45d5203bfd966e4b694ffca5f0177f81c80b9153b6
MD5 d6c4b5234cb4e246c34b84e17904b0a9
BLAKE2b-256 4be3ba043e59e16ff189145e35bc9aa25fb1aad6410f80f41114dc5a9a9679a3

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: fisher-0.1.14-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 81.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fisher-0.1.14-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7a3fde5cbdbfa08bc2b45694ca1f2dc009e45369df0e34ae86ed8d17050c9833
MD5 f0a5c7afc05c48bbb5c218f3a40561b0
BLAKE2b-256 525e7392b508c45cc383d0e02e207aa88fdb036165f18e7f519715009e5cbf6f

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b00d2fd1e4cad8f43aee37e79079ee10018d3ce8f0f01a4417ae5f497015464
MD5 2760642ef7e54a3e3fdeafa5eccd8168
BLAKE2b-256 5ea911601341de265db2b1818b2203ec97d75cbd50a810e8ea1dcd7f2d6aa2b4

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 864521fc1e787cc0c5e021061d1456df1fbbf42b471237ada9b6ed957014b6a2
MD5 f9372276f807dc3dc674fd6de6d2fddb
BLAKE2b-256 a15f2d7d417300f8da2276e0d2ad97a13538e6bc61625a302c6b5ccf03aa946a

See more details on using hashes here.

File details

Details for the file fisher-0.1.14-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fisher-0.1.14-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bfefef89743d4413e80ecebd8fee8f9185bc1a7346994a6034a0565e817d943b
MD5 303392ad240f564d25b9e4ba4398f85b
BLAKE2b-256 bd2f587e3c02d3c5d4fdc3beea540d953028a187b9d40afdef81bf9813003b4b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page