{"id":23706,"library":"fast-histogram","title":"fast-histogram","description":"Fast simple 1D and 2D histograms for Python, using C extensions. Current version: 0.14, released 2024-08-12. Cadence: irregular.","status":"active","version":"0.14","language":"python","source_language":"en","source_url":"https://github.com/astrofrog/fast-histogram","tags":["histogram","fast","numpy","1d","2d"],"install":[{"cmd":"pip install fast-histogram","lang":"bash","label":"Install"}],"dependencies":[{"reason":"Core dependency for array operations","package":"numpy","optional":false}],"imports":[{"note":"Module name uses underscore, not hyphen","wrong":"from fasthistogram import histogram1d","symbol":"histogram1d","correct":"from fast_histogram import histogram1d"},{"note":"Correct import path","wrong":"from fast_histogram import histogram2d","symbol":"histogram2d","correct":"from fast_histogram import histogram2d"}],"quickstart":{"code":"import numpy as np\nfrom fast_histogram import histogram1d\n\ndata = np.random.randn(1000)\nbins = 50\nrange_vals = (-3, 3)\n\nh = histogram1d(data, bins=bins, range=range_vals)\nprint(h.shape)","lang":"python","description":"Compute a 1D histogram with 50 bins over range [-3, 3]."},"warnings":[{"fix":"Upgrade to v0.14 and ensure Python 3.9+ and numpy >=1.22.","message":"v0.13 dropped support for Python <=3.8 and requires numpy >= 1.20, v0.14 requires Python >=3.9 and numpy >= 1.22 to support numpy 2.0.","severity":"breaking","affected_versions":"<0.13"},{"fix":"Always specify range as a tuple (min, max) or (xmin, xmax, ymin, ymax) for 2D.","message":"The range argument must be provided explicitly; it defaults to None which raises an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Check that weights are handled identically; fast-histogram does not support normed/density directly.","message":"The numpy.histogram and numpy.histogram2d are slower; this library is intended as a drop-in replacement but weights behavior differs slightly.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"search_vec":"'-08':20 '-12':21 '0.14':17 '1d':6,27 '2024':19 '2d':8,28 'c':13 'cadenc':22 'current':15 'extens':14 'fast':2,4,25 'fast-histogram':1 'histogram':3,9,24 'irregular':23 'numpi':26 'python':11 'releas':18 'simpl':5 'use':12 'version':16","created_at":"2026-05-01T08:09:12.000988+00:00","updated_at":"2026-05-01T08:09:12.000988+00:00","problems":[{"fix":"Install correctly: pip install fast-histogram. Then import: from fast_histogram import histogram1d","cause":"Trying to import from 'fast_histogram' but installed package is 'fast-histogram'.","error":"ModuleNotFoundError: No module named 'fast_histogram'"},{"fix":"Always provide a range tuple, e.g., histogram1d(data, bins=50, range=(-3, 3))","cause":"range not provided or set to None.","error":"ValueError: The 'range' argument is required"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.14","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/astrofrog/fast-histogram","docs":null,"changelog":null,"pypi":"https://pypi.org/project/fast-histogram/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}