{"id":13422095,"url":"https://github.com/janpipek/physt","last_synced_at":"2026-01-27T00:23:18.851Z","repository":{"id":44937466,"uuid":"54721043","full_name":"janpipek/physt","owner":"janpipek","description":"Python histogram library - histograms as updateable, fully semantic objects with visualization tools. [P]ython [HYST]ograms.","archived":false,"fork":false,"pushed_at":"2025-10-05T08:16:14.000Z","size":24433,"stargazers_count":134,"open_issues_count":39,"forks_count":15,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2025-10-05T09:14:15.106Z","etag":null,"topics":["2d-histograms","heatmap","histogram","plotting","python","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janpipek.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.txt","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":"2016-03-25T13:41:56.000Z","updated_at":"2025-10-05T08:16:17.000Z","dependencies_parsed_at":"2023-02-16T07:30:29.120Z","dependency_job_id":"725ee2c6-7a77-4508-a98a-193590f40aaf","html_url":"https://github.com/janpipek/physt","commit_stats":null,"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"purl":"pkg:github/janpipek/physt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpipek%2Fphyst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpipek%2Fphyst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpipek%2Fphyst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpipek%2Fphyst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janpipek","download_url":"https://codeload.github.com/janpipek/physt/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpipek%2Fphyst/sbom","scorecard":{"id":505544,"data":{"date":"2025-08-11","repo":{"name":"github.com/janpipek/physt","commit":"faaa7f81da260de8cf76ba372378f5311975015f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/app.yaml: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":"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":"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/app.yaml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/janpipek/physt/app.yaml/dev?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/app.yaml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/janpipek/physt/app.yaml/dev?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/app.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/janpipek/physt/app.yaml/dev?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/app.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/janpipek/physt/app.yaml/dev?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/app.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/janpipek/physt/app.yaml/dev?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/app.yaml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/janpipek/physt/app.yaml/dev?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction 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":"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":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations 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: MIT 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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'dev'"],"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":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 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-19T23:10:35.913Z","repository_id":44937466,"created_at":"2025-08-19T23:10:35.913Z","updated_at":"2025-08-19T23:10:35.913Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28792901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: 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":["2d-histograms","heatmap","histogram","plotting","python","visualization"],"created_at":"2024-07-30T23:00:36.786Z","updated_at":"2026-01-27T00:23:18.446Z","avatar_url":"https://github.com/janpipek.png","language":"Python","readme":"# physt ![Physt logo](docs/physt-logo64.png)\n\nP(i/y)thon h(i/y)stograms. Inspired (and based on) numpy.histogram, but designed for humans(TM) on steroids(TM).\n\nCreate rich histogram objects from **numpy** or **dask** arrays, from **pandas** and **polars** series/dataframes,\nfrom **xarray** datasets and a few more types of objects. Manipulate them with ease, plot them with **matplotlib**,\n**vega** or **plotly**.\n\nIn short, whatever you want to do with histograms, **physt** aims to be on your side.\n\n[![ReadTheDocs](https://readthedocs.org/projects/physt/badge/?version=latest)](http://physt.readthedocs.io/en/latest/)\n[![Join the chat at https://gitter.im/physt/Lobby](https://badges.gitter.im/physt/physt.svg)](https://gitter.im/physt/physt)\n[![PyPI downloads](https://img.shields.io/pypi/dm/physt)](https://pypi.org/project/physt/)\n[![PyPI version](https://badge.fury.io/py/physt.svg)](https://badge.fury.io/py/physt)\n[![Anaconda-Server Badge](https://anaconda.org/janpipek/physt/badges/version.svg)](https://anaconda.org/janpipek/physt)\n[![Anaconda-Server Badge](https://anaconda.org/janpipek/physt/badges/license.svg)](https://anaconda.org/janpipek/physt)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n## See it in action\n\nWith [`uv`](https://docs.astral.sh/uv/) installed, you can run the following command without needing to install\nanything to see some examples in action:\n\n```shell\nuv run --with \"physt[terminal]\u003e=0.8.3\" -m physt.examples\n```\n\n## Command-line interface (experimental)\n\nYou can run (and install) `physt` as a command-line application to quickly analyse\ndata files. This functionality is currently in development.\n\n```shell\nuv run physt h1 \"src/physt/examples/munros.csv\" -c height  -p -n 10\n```\n\nFor more information, use the `--help` flag.\n\n## Simple example\n\n```python\nfrom physt import h1\n\n# Create the sample\nheights = [160, 155, 156, 198, 177, 168, 191, 183, 184, 179, 178, 172, 173, 175,\n           172, 177, 176, 175, 174, 173, 174, 175, 177, 169, 168, 164, 175, 188,\n           178, 174, 173, 181, 185, 166, 162, 163, 171, 165, 180, 189, 166, 163,\n           172, 173, 174, 183, 184, 161, 162, 168, 169, 174, 176, 170, 169, 165]\n\nhist = h1(heights, 10)           # \u003c--- get the histogram data\nhist \u003c\u003c 190                      # \u003c--- add a forgotten value\nhist.plot()                      # \u003c--- and plot it\n```\n\n![Heights plot](docs/heights.png)\n\n## 2D example\n\n```python\nfrom physt import h2\nimport seaborn as sns\n\niris = sns.load_dataset('iris')\niris_hist = h2(iris[\"sepal_length\"], iris[\"sepal_width\"], \"pretty\", bin_count=[12, 7], name=\"Iris\")\niris_hist.plot(show_zero=False, cmap=\"gray_r\", show_values=True);\n```\n\n![Iris 2D plot](docs/iris-2d.png)\n\n## 3D directional example\n\n```python\nimport numpy as np\nfrom physt import special_histograms\n\n# Generate some sample data\ndata = np.empty((1000, 3))\ndata[:,0] = np.random.normal(0, 1, 1000)\ndata[:,1] = np.random.normal(0, 1.3, 1000)\ndata[:,2] = np.random.normal(1, .6, 1000)\n\n# Get histogram data (in spherical coordinates)\nh = special_histograms.spherical(data)\n\n# And plot its projection on a globe\nh.projection(\"theta\", \"phi\").plot.globe_map(density=True, figsize=(7, 7), cmap=\"rainbow\")\n```\n\n![Directional 3D plot](docs/globe.png)\n\nSee more in docstring's and notebooks:\n\n- Basic tutorial: \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/tutorial.ipynb\u003e\n- Binning: \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/binning.ipynb\u003e\n- 2D histograms: \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/2d_histograms.ipynb\u003e\n- Special histograms (polar, spherical, cylindrical - *beta*): \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/special_histograms.ipynb\u003e\n- Adaptive histograms: \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/adaptive_histogram.ipynb\u003e\n- Use dask for large (not \"big\") data - *alpha*: \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/dask.ipynb\u003e\n- Geographical bins . *alpha*: \u003chttp://nbviewer.jupyter.org/github/janpipek/physt/blob/dev/docs/geospatial.ipynb\u003e\n...and others, see the `docs` directory.\n\n## Installation\n\nUsing pip:\n\n`pip install physt`\n\nor conda:\n\n`conda install -c janpipek physt`\n\n## Features\n\n### Implemented\n\n* 1D histograms\n* 2D histograms\n* ND histograms\n* Some special histograms\n  - 2D polar coordinates (with plotting)\n  - 3D spherical / cylindrical coordinates (beta)\n* Adaptive rebinning for on-line filling of unknown data (beta)\n* Non-consecutive bins\n* Memory-effective histogramming of dask arrays (beta)\n* Understands any numpy-array-like object\n* Keep underflow / overflow / missed bins\n* Basic numeric operations (* / + -)\n* Items / slice selection (including mask arrays)\n* Add new values (fill, fill_n)\n* Cumulative values, densities\n* Simple statistics for original data (mean, std, sem) - only for 1D histograms\n* Plotting with several backends\n  - matplotlib (static plots with many options)\n  - vega (interactive plots, broken, help wanted!)\n  - folium (experimental for geo-data)\n  - plotly (very basic, help wanted!)\n  - ascii (experimental)\n* Algorithms for optimized binning\n  - pretty (nice rounded bin edges)\n  - mathematical (statistical, quantile-based, geometrical, ...)\n* IO, conversions\n  - I/O JSON\n  - I/O xarray.DataSet (experimental)\n  - O ROOT file (experimental)\n  - O pandas.DataFrame (basic)\n\n### Planned\n* Rebinning\n  - using reference to original data?\n  - merging bins\n* Statistics (based on original data)?\n* Stacked histograms (with names)\n* Potentially holoviews plotting backend (instead of the discontinued bokeh one)\n\n### Not planned\n* Kernel density estimates - use your favourite statistics package (like `seaborn`)\n* Rebinning using interpolation - it should be trivial to use `rebin` (\u003chttps://github.com/jhykes/rebin\u003e) with physt\n\nRationale (for both): physt is dumb, but precise.\n\n## Dependencies\n\n- Python 3.9+\n- Numpy 1.25+\n- (optional) polars (1.0+), pandas (1.5+), dask, xarray - if you want to histogram those\n- (optional) matplotlib - simple visualization\n- (optional) xarray - I/O\n- (optional) astropy - additional binning algorithms\n- (optional) folium - map plotting\n- (optional) rich - console output including plots\n- (testing) pytest\n- (docs) sphinx, sphinx_rtd_theme, ipython\n\n## Publicity\n\nTalk at PyData Berlin 2018:\n- \u003chttps://janpipek.github.io/pydata2018-berlin/\u003e - repository with slides and links\n- \u003chttps://www.youtube.com/watch?v=ZG-wH3-Up9Y\u003e - video of the talk\n\n## Contribution\n\nI am looking for anyone interested in using / developing physt. You can contribute by reporting errors, implementing missing features and suggest new one.\n\nThanks to:\n- **Ryan Mackenzie White** - \u003chttps://github.com/ryanmackenziewhite\u003e for the protobuf idea and first implementation.\n- **Ben Greiner** - \u003chttps://github.com/bnavigator\u003e for the numpy\u003e=2.0 PR though I implemented it in a different way eventually.\n\nPatches:\n- **Matthieu Marinangeli** - \u003chttps://github.com/marinang\u003e\n\n## Alternatives and inspirations\n\n* \u003chttps://github.com/boostorg/histogram\u003e (C++, part of boost)\n* \u003chttps://github.com/scikit-hep/boost-histogram\u003e (Python wrapper around boost-histogram)\n* \u003chttps://github.com/ibab/matplotlib-hep\u003e\n","funding_links":[],"categories":["Visualization","Data Visualization"],"sub_categories":["General Purposes"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanpipek%2Fphyst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanpipek%2Fphyst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanpipek%2Fphyst/lists"}