{"id":13398688,"url":"https://github.com/pydata/bottleneck","last_synced_at":"2026-04-02T01:28:47.000Z","repository":{"id":38146220,"uuid":"1117948","full_name":"pydata/bottleneck","owner":"pydata","description":"Fast NumPy array functions written in C","archived":false,"fork":false,"pushed_at":"2026-03-26T15:31:43.000Z","size":13723,"stargazers_count":1171,"open_issues_count":48,"forks_count":114,"subscribers_count":32,"default_branch":"master","last_synced_at":"2026-03-27T06:18:32.863Z","etag":null,"topics":["c","c-extension","fast","numpy","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pydata.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2010-11-27T23:21:22.000Z","updated_at":"2026-03-27T05:56:54.000Z","dependencies_parsed_at":"2023-02-17T05:31:35.193Z","dependency_job_id":"79b02729-1c54-4094-97c1-a830409eeb3b","html_url":"https://github.com/pydata/bottleneck","commit_stats":{"total_commits":1219,"total_committers":33,"mean_commits":36.93939393939394,"dds":"0.30352748154224773","last_synced_commit":"c1f95295ff81ac35014485c26fc7c942b866b13c"},"previous_names":["kwgoodman/bottleneck"],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/pydata/bottleneck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pydata%2Fbottleneck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pydata%2Fbottleneck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pydata%2Fbottleneck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pydata%2Fbottleneck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pydata","download_url":"https://codeload.github.com/pydata/bottleneck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pydata%2Fbottleneck/sbom","scorecard":{"id":574741,"data":{"date":"2025-08-11","repo":{"name":"github.com/pydata/bottleneck","commit":"7a0110dff7e14012fb2924ba50668b2f1f83008c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.6,"checks":[{"name":"Code-Review","score":6,"reason":"Found 12/19 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":2,"reason":"0 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: OSSFuzz integration found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/pydata/bottleneck/ci.yml/master?enable=pin","Warn: containerImage not pinned by hash: bottleneck/tests/docker/centos_7_min_deps/Dockerfile:1: pin your Docker image by updating centos:7 to centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4","Warn: containerImage not pinned by hash: bottleneck/tests/docker/centos_8_min_deps/Dockerfile:1: pin your Docker image by updating centos:8 to centos:8@sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177","Warn: containerImage not pinned by hash: bottleneck/tests/docker/ubuntu_devel_min_deps/Dockerfile:1: pin your Docker image by updating ubuntu:devel to ubuntu:devel@sha256:acdb2d352183cf75a2cb296fe82514f8b983f461b5d8832b8968ec202db59952","Warn: containerImage not pinned by hash: bottleneck/tests/docker/ubuntu_lts_min_deps/Dockerfile:1: pin your Docker image by updating ubuntu:latest to ubuntu:latest@sha256:7c06e91f61fa88c08cc74f7e1b7c69ae24910d745357e0dfe1d2c0322aaf20f9","Warn: pipCommand not pinned by hash: bottleneck/tests/docker/centos_7_min_deps/Dockerfile:4","Warn: pipCommand not pinned by hash: bottleneck/tests/docker/centos_8_min_deps/Dockerfile:4","Warn: pipCommand not pinned by hash: bottleneck/tests/docker/ubuntu_devel_min_deps/Dockerfile:4","Warn: pipCommand not pinned by hash: bottleneck/tests/docker/ubuntu_lts_min_deps/Dockerfile:4","Warn: pipCommand not pinned by hash: tools/travis/bn_setup.sh:12","Warn: pipCommand not pinned by hash: tools/travis/bn_setup.sh:14","Warn: pipCommand not pinned by hash: tools/travis/conda_install.sh:27","Warn: pipCommand not pinned by hash: tools/travis/conda_install.sh:29","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   4 containerImage dependencies pinned","Info:   0 out of   8 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:89"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T17:21:20.993Z","repository_id":38146220,"created_at":"2025-08-20T17:21:20.993Z","updated_at":"2025-08-20T17:21:20.993Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","c-extension","fast","numpy","python"],"created_at":"2024-07-30T19:00:30.607Z","updated_at":"2026-04-02T01:28:46.991Z","avatar_url":"https://github.com/pydata.png","language":"Python","readme":".. image:: https://github.com/pydata/bottleneck/actions/workflows/ci.yml/badge.svg?branch=master\n    :target: https://github.com/pydata/bottleneck/actions/workflows/ci.yml\n\n\n==========\nBottleneck\n==========\n\nBottleneck is a collection of fast NumPy array functions written in C.\n\nLet's give it a try. Create a NumPy array:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import numpy as np\n    \u003e\u003e\u003e a = np.array([1, 2, np.nan, 4, 5])\n\nFind the nanmean:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import bottleneck as bn\n    \u003e\u003e\u003e bn.nanmean(a)\n    3.0\n\nMoving window mean:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e bn.move_mean(a, window=2, min_count=1)\n    array([ 1. ,  1.5,  2. ,  4. ,  4.5])\n\nBenchmark\n=========\n\nBottleneck comes with a benchmark suite:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e bn.bench()\n    Bottleneck performance benchmark\n        Bottleneck 1.6.0.post0.dev32; Numpy 2.4.2\n        Speed is NumPy time divided by Bottleneck time\n        NaN means approx one-fifth NaNs; float64 used\n\n                no NaN     no NaN      NaN       no NaN      NaN\n                (100,)  (1000,1000)(1000,1000)(1000,1000)(1000,1000)\n                axis=0     axis=0     axis=0     axis=1     axis=1\n    nansum         12.2        0.4        2.0        0.4        2.0\n    nanmean        29.8        0.8        2.3        0.5        2.2\n    nanstd         34.2        0.8        2.2        0.7        2.1\n    nanvar         32.9        0.8        2.2        0.7        2.1\n    nanmin         12.7        0.1        0.1        0.1        0.1\n    nanmax         12.8        0.1        0.1        0.1        0.1\n    median         38.7        1.1        6.7        1.0        6.5\n    nanmedian      38.4        2.1        2.2        1.9        2.1\n    ss              5.2        0.3        0.3        0.3        0.3\n    nanargmin      25.9        1.2        3.2        0.9        2.8\n    nanargmax      26.0        1.2        3.2        0.9        2.8\n    anynan          8.1        0.3       42.1        0.3       35.7\n    allnan         11.6       58.4       58.6       47.1       47.5\n    rankdata       14.9        1.4        1.4        1.5        1.5\n    nanrankdata    16.4        1.5        1.4        1.6        1.5\n    partition       2.0        1.1        1.6        1.0        1.5\n    argpartition    2.4        1.3        1.8        1.2        1.8\n    replace         7.4        2.9        2.9        2.9        2.9\n    push         1453.8       16.2        8.8       24.1       10.3\n    move_sum     1159.7       89.4      143.3      168.6      192.1\n    move_mean    2575.8      182.0      171.7      214.2      202.4\n    move_std     2863.9      137.4      274.5      145.1      310.7\n    move_var     2792.3      137.9      279.7      154.1      325.8\n    move_min      690.7        4.1        4.2        5.2        5.2\n    move_max      659.9        4.2        4.2        5.2        5.2\n    move_argmin  1369.1       33.7       77.5       35.7       83.5\n    move_argmax  1344.7       32.8       78.2       35.9       83.3\n    move_median   686.6      153.5      156.9      156.0      159.8\n    move_rank     502.0        1.9        2.0        1.8        2.1\n\nYou can also run a detailed benchmark for a single function using, for\nexample, the command:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e bn.bench_detailed(\"move_median\", fraction_nan=0.3)\n\nOnly arrays with data type (dtype) int32, int64, float32, and float64 are\naccelerated. All other dtypes result in calls to slower, unaccelerated\nfunctions. In the rare case of a byte-swapped input array (e.g. a big-endian\narray on a little-endian operating system) the function will not be\naccelerated regardless of dtype.\n\nWhere\n=====\n\n===================   ========================================================\n download             https://pypi.python.org/pypi/Bottleneck\n docs                 https://bottleneck.readthedocs.io\n code                 https://github.com/pydata/bottleneck\n mailing list         https://groups.google.com/group/bottle-neck\n===================   ========================================================\n\nLicense\n=======\n\nBottleneck is distributed under a Simplified BSD license. See the LICENSE file\nand LICENSES directory for details.\n\nInstall\n=======\n\nBottleneck provides binary wheels on PyPI for all the most common platforms.\nBinary packages are also available in conda-forge. We recommend installing binaries\nwith ``pip``, ``uv``, ``conda`` or similar - it's faster and easier than building\nfrom source.\n\nInstalling from source\n----------------------\n\nRequirements:\n\n======================== ============================================================================\nBottleneck               Python \u003e3.9; NumPy 1.16.0+\nCompile                  gcc, clang, MinGW or MSVC\nUnit tests               pytest\nDocumentation            sphinx, numpydoc\n======================== ============================================================================\n\nTo install Bottleneck on Linux, Mac OS X, et al.:\n\n.. code-block:: console\n\n    $ pip install .\n\nTo install bottleneck on Windows, first install MinGW and add it to your\nsystem path. Then install Bottleneck with the command:\n\n.. code-block:: console\n\n    $ python setup.py install --compiler=mingw32\n\nUnit tests\n==========\n\nAfter you have installed Bottleneck, run the suite of unit tests:\n\n.. code-block:: pycon\n\n  In [1]: import bottleneck as bn\n\n  In [2]: bn.test()\n  ============================= test session starts =============================\n  platform linux -- Python 3.7.4, pytest-4.3.1, py-1.8.0, pluggy-0.12.0\n  hypothesis profile 'default' -\u003e database=DirectoryBasedExampleDatabase('/home/chris/code/bottleneck/.hypothesis/examples')\n  rootdir: /home/chris/code/bottleneck, inifile: setup.cfg\n  plugins: openfiles-0.3.2, remotedata-0.3.2, doctestplus-0.3.0, mock-1.10.4, forked-1.0.2, cov-2.7.1, hypothesis-4.32.2, xdist-1.26.1, arraydiff-0.3\n  collected 190 items\n\n  bottleneck/tests/input_modification_test.py ........................... [ 14%]\n  ..                                                                      [ 15%]\n  bottleneck/tests/list_input_test.py .............................       [ 30%]\n  bottleneck/tests/move_test.py .................................         [ 47%]\n  bottleneck/tests/nonreduce_axis_test.py ....................            [ 58%]\n  bottleneck/tests/nonreduce_test.py ..........                           [ 63%]\n  bottleneck/tests/reduce_test.py ....................................... [ 84%]\n  ............                                                            [ 90%]\n  bottleneck/tests/scalar_input_test.py ..................                [100%]\n\n  ========================= 190 passed in 46.42 seconds =========================\n  Out[2]: True\n\nIf developing in the git repo, simply run ``py.test``\n","funding_links":[],"categories":["Python","C","Basic Components","Linear Algebra / Statistics Toolkit","数据容器和结构","Data Containers \u0026 Dataframes","Language based EO Libraries"],"sub_categories":["Python Performance Booster","General Purpose Tensor Library","Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpydata%2Fbottleneck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpydata%2Fbottleneck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpydata%2Fbottleneck/lists"}