colliderscope.Histogram.to_json(fname: str | Path | IOBase, encoding: str = 'utf-8') None

Serialise and store Histogram object as a JSON file.

Changed in version 0.2.3: fname accepts file-like object.

Parameters:
fname : str or Path or file-like

Location on disk, or file-object, to save the data. If gzip compression is desired, use the ".gz" extension.

encoding : str

Standard used to encode the text into binary formats. Default is "utf-8".


Last update: Jun 27, 2025