# uproot.interpretation.library.Pandas

Defined in [uproot.interpretation.library](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/interpretation/library.py) on [line 841](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/interpretation/library.py#L841).

| **Inheritance order:**                                                                  |
|-----------------------------------------------------------------------------------------|
| 1. [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md) |

### *class* uproot.interpretation.library.Pandas

A [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md) that presents `TBranch`
data as Pandas Series and DataFrames. The standard name for this library is
`"pd"`.

The single-`TBranch` (with a single `TLeaf`) form for this library is
`pandas.Series`, and the “group” form is `pandas.DataFrame`.

The “group” behavior for this library is:

* `how=None` or a string: passed to `pandas.merge` as its `how`
  parameter, which would be relevant if jagged arrays with different
  multiplicity are requested.
* `how=dict`: a dict of str → array, mapping the names to
  `pandas.Series`.
* `how=tuple`: a tuple of `pandas.Series`, in the order requested.
  (Names are assigned to the `pandas.Series`.)
* `how=list`: a list of `pandas.Series`, in the order requested.
  (Names are assigned to the `pandas.Series`.)

Pandas Series and DataFrames are indexed, so `global_index` adjusts them.

<a id="uproot-interpretation-library-pandas-imported"></a>

## imported

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.imported

<a id="uproot-interpretation-library-pandas-empty"></a>

## empty

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.empty(shape, dtype)

* **Parameters:**
  * **shape** (*tuple* *of* *int*) – NumPy array `shape`. (The first item must
    be zero.)
  * **dtype** (`numpy.dtype` or its constructor argument) – NumPy array
    `dtype`.

Returns an empty NumPy-like array.

<a id="uproot-interpretation-library-pandas-zeros"></a>

## zeros

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.zeros(shape, dtype)

* **Parameters:**
  * **shape** (*tuple* *of* *int*) – NumPy array `shape`. (The first item must
    be zero.)
  * **dtype** (`numpy.dtype` or its constructor argument) – NumPy array
    `dtype`.

Returns a NumPy-like array of zeros.

<a id="uproot-interpretation-library-pandas-finalize"></a>

## finalize

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.finalize(array, branch, interpretation, entry_start, entry_stop, options)

* **Parameters:**
  * **array** (*array*) – Internal, temporary, trimmed array. If this is a
    NumPy array, it may be identical to the output array.
  * **branch** ([uproot.TBranch](uproot.behaviors.TBranch.TBranch.html.md)) – The `TBranch`
    that is represented by this array.
  * **interpretation** ([uproot.interpretation.Interpretation](uproot.interpretation.Interpretation.html.md)) – The
    interpretation that produced the `array`.
  * **entry_start** (*int*) – First entry that is included in the output.
  * **entry_stop** (*int*) – FIrst entry that is excluded (one greater than
    the last entry that is included) in the output.
  * **interp_options** (*dict*) – Flags and other options passed through the
    interpretation process.

Create a library-appropriate output array for this temporary `array`.

This array would represent one `TBranch` (i.e. not a “group”).

<a id="uproot-interpretation-library-pandas-group"></a>

## group

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.group(arrays, expression_context, how)

* **Parameters:**
  * **arrays** (*dict* *of* *str → array*) – Mapping from names to finalized
    array objets to combine into a group.
  * **expression_context** (*list* *of*  *(**str* *,* *dict* *)* *tuples*) – Expression strings
    and a dict of metadata about each.
  * **how** (*None* *,* *str* *, or* *container type*) – Library-dependent instructions
    for grouping. The only recognized container types are `tuple`,
    `list`, and `dict`. Note that the container *type itself*
    must be passed as `how`, not an instance of that type (i.e.
    `how=tuple`, not `how=()`).
    For `library="ak"`, passing `how="zip"` applies `ak.zip`
    to interleave data from compatible branches.

Combine the finalized `arrays` into a library-appropriate group type.

<a id="uproot-interpretation-library-pandas-global-index"></a>

## global_index

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.global_index(arrays, global_offset)

* **Parameters:**
  * **array** (*array*) – The library-appropriate array whose global index
    needs adjustment.
  * **global_offset** (*int*) – A number to add to the global index of
    `array` to correct it.

Apply *in-place* corrections to the global index of `array` by adding
`global_offset`.

Even though the operation is performed *in-place*, this method returns
the `array`.

<a id="uproot-interpretation-library-pandas-concatenate"></a>

## concatenate

Inherited from [uproot.interpretation.library.Library](uproot.interpretation.library.Library.html.md).

#### Pandas.concatenate(all_arrays)

* **Parameters:**
  **all_arrays** (*list* *of* *arrays*) – A list of library-appropriate arrays
  that need to be concatenated.

Returns a concatenated version of `all_arrays`.
