# uproot.behaviors.TH3.TH3

Defined in [uproot.behaviors.TH3](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/behaviors/TH3.py) on [line 15](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/behaviors/TH3.py#L15).

| **Inheritance order:**                                                           |
|----------------------------------------------------------------------------------|
| 1. [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md) |

### *class* uproot.behaviors.TH3.TH3

Behaviors for three-dimensional histograms: descendants of ROOT’s
`TH3`, not including `TProfile3D`.

<a id="uproot-behaviors-th3-th3-to-numpy"></a>

## to_numpy

#### TH3.to_numpy(flow=False, dd=False)

* **Parameters:**
  * **flow** (*bool*) – If True, include underflow and overflow bins; otherwise,
    only normal (finite-width) bins are included.
  * **dd** (*bool*) – If True, the return type follows
    [numpy.histogramdd](https://numpy.org/doc/stable/reference/generated/numpy.histogramdd.html);
    otherwise, it follows [numpy.histogram](https://numpy.org/doc/stable/reference/generated/numpy.histogram.html)
    and [numpy.histogram2d](https://numpy.org/doc/stable/reference/generated/numpy.histogram2d.html).

Converts the histogram into a form like the ones produced by the NumPy
histogram functions.

<a id="uproot-behaviors-th3-th3-name"></a>

## name

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.name

The name of the histogram.

<a id="uproot-behaviors-th3-th3-title"></a>

## title

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.title

The title of the histogram.

<a id="uproot-behaviors-th3-th3-axes"></a>

## axes

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.axes

<a id="uproot-behaviors-th3-th3-axis"></a>

## axis

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.axis(axis)

Returns a specified [uproot.behaviors.TAxis.TAxis](uproot.behaviors.TAxis.TAxis.html.md) object.

The `axis` can be specified as

* a non-negative integer: `0` is the first axis, `1` is the second,
  and `2` is the third.
* a negative integer: `-1` is the last axis, `-2` is the
  second-to-last, and `-3` is the third-to-last.
* a string: `"x"` is the first axis, `"y"` is the second, and `"z"`
  is the third

(assuming that the histogram dimension supports a given `axis`).

<a id="uproot-behaviors-th3-th3-weighted"></a>

## weighted

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.weighted

True if the histogram has weights (`fSumw2`); False otherwise.

<a id="uproot-behaviors-th3-th3-kind"></a>

## kind

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.kind

<a id="uproot-behaviors-th3-th3-values"></a>

## values

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.values(flow=False)

* **Parameters:**
  **flow** (*bool*) – If True, include underflow and overflow bins before and
  after the normal (finite-width) bins.

Bin contents as a 1, 2, or 3 dimensional `numpy.ndarray`. The
`numpy.dtype` of this array depends on the histogram type.

Setting `flow=True` increases the length of each dimension by two.

<a id="uproot-behaviors-th3-th3-errors"></a>

## errors

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.errors(flow=False)

* **Parameters:**
  **flow** (*bool*) – If True, include underflow and overflow bins before and
  after the normal (finite-width) bins.

Errors (uncertainties) in the [values](uproot.behaviors.TH1.Histogram.html.md#uproot-behaviors-th1-histogram-values)
as a 1, 2, or 3 dimensional `numpy.ndarray` of `numpy.float64`.

If `fSumw2` (weights) are available, they will be used in the
calculation of the errors. If not, errors are assumed to be the square
root of the values.

Setting `flow=True` increases the length of each dimension by two.

<a id="uproot-behaviors-th3-th3-variances"></a>

## variances

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.variances(flow=False)

* **Parameters:**
  **flow** (*bool*) – If True, include underflow and overflow bins before and
  after the normal (finite-width) bins.

Variances (uncertainties squared) in the
[values](uproot.behaviors.TH1.Histogram.html.md#uproot-behaviors-th1-histogram-values) as a 1, 2, or 3
dimensional `numpy.ndarray` of `numpy.float64`.

If `fSumw2` (weights) are available, they will be used in the
calculation of the variances. If not, variances are assumed to be equal
to the values.

Setting `flow=True` increases the length of each dimension by two.

<a id="uproot-behaviors-th3-th3-counts"></a>

## counts

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.counts(flow=False)

* **Parameters:**
  **flow** (*bool*) – If True, include underflow and overflow bins before and
  after the normal (finite-width) bins.

Returns the (possibly weighted) number of entries in each bin. For
histograms, this is equal to [values](uproot.behaviors.TH1.Histogram.html.md#uproot-behaviors-th1-histogram-values).

<a id="uproot-behaviors-th3-th3-to-boost"></a>

## to_boost

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.to_boost(metadata=None, axis_metadata=None)

* **Parameters:**
  * **metadata** (*dict* *of* *str → str*) – Metadata to collect (keys) and
    their C++ class member names (values).
  * **axis_metadata** (*dict* *of* *str → str*) – Metadata to collect from
    each axis.

Converts the histogram into a `boost-histogram` object.

<a id="uproot-behaviors-th3-th3-to-hist"></a>

## to_hist

Inherited from [uproot.behaviors.TH1.Histogram](uproot.behaviors.TH1.Histogram.html.md).

#### TH3.to_hist(metadata=None, axis_metadata=None)

* **Parameters:**
  * **metadata** (*dict* *of* *str → str*) – Metadata to collect (keys) and
    their C++ class member names (values).
  * **axis_metadata** (*dict* *of* *str → str*) – Metadata to collect from
    each axis.

Converts the histogram into a `hist` object.
