Cat

class coffea.hist.Cat(name, label, sorting='identifier')[source]

Bases: SparseAxis

A category axis with name and label

Parameters:
  • name (str) – is used as a keyword in histogram filling, immutable

  • label (str) – describes the meaning of the axis, can be changed

  • sorting ({'identifier', 'placement', 'integral'}, optional) – Axis sorting when listing identifiers. Default ‘placement’ Changing this setting can effect the order of stack plotting in hist.plot1d.

The number of categories is arbitrary, and can be filled sparsely Identifiers are strings

Attributes Summary

size

Number of bins

sorting

Sorting definition to adhere to

Methods Summary

identifiers()

List of StringBin identifiers

index(identifier)

Index of a identifer or label

Attributes Documentation

size

Number of bins

sorting

Sorting definition to adhere to

See Cat constructor for possible values

Methods Documentation

identifiers()[source]

List of StringBin identifiers

index(identifier)[source]

Index of a identifer or label

Parameters:

identifier (str or StringBin) – The identifier to lookup

Returns a StringBin corresponding to the given argument (trival in the case where a StringBin was passed) and saves a reference internally in the case where the identifier was not seen before by this axis.