---
title: DataBin (v1.1)
description: API reference for qiskit.primitives.DataBin in qiskit v1.1
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/1.1/qiskit.primitives.DataBin
---

# DataBin

*class* `qiskit.primitives.DataBin(*, shape=(), **data)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/primitives/containers/data_bin.py#L32-L143)

Bases: `ShapedMixin`

Namespace for storing data.

```python
data = DataBin(
    alpha=BitArray.from_bitstrings(["0010"]),
    beta=np.array([1.2])
)

print("alpha data:", data.alpha)
print("beta data:", data.beta)
```

**Parameters**

- **data** – Name/value data to place in the data bin.
- **shape** (*ShapeInput*) – The leading shape common to all entries in the data bin. This defaults to the trivial leading shape of `()` that is compatible with all objects.

**Raises**

- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – If a name overlaps with a method name on this class.
- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – If some value is inconsistent with the provided shape.

## Attributes

### ndim

### shape

### size

## Methods

### items

`items()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/primitives/containers/data_bin.py#L125-L127)

Return a view of field names and values

**Return type**

[*ItemsView*](https://docs.python.org/3/library/typing.html#typing.ItemsView)\[[str](https://docs.python.org/3/library/stdtypes.html#str), [*Any*](https://docs.python.org/3/library/typing.html#typing.Any)]

### keys

`keys()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/primitives/containers/data_bin.py#L117-L119)

Return a view of field names.

**Return type**

[*KeysView*](https://docs.python.org/3/library/typing.html#typing.KeysView)\[[str](https://docs.python.org/3/library/stdtypes.html#str)]

### values

`values()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/primitives/containers/data_bin.py#L121-L123)

Return a view of values.

**Return type**

[*ValuesView*](https://docs.python.org/3/library/typing.html#typing.ValuesView)\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any)]
