> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# atoti.Hierarchy.isin()

#### Hierarchy.isin(\*members: ScalarConstantT\_co) → MembershipCondition\[TypeAliasForwardRef, 'IN', TypeVar] | RelationalCondition\[TypeAliasForwardRef, 'EQ', TypeVar]

#### Hierarchy.isin(\*member\_paths: [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ScalarConstantT\_co, ...]) → HierarchyMembershipCondition\['IN', TypeVar]

Return a condition evaluating to `True` where this hierarchy’s current member (or its path) is included in the given *members* (or *member\_paths*), and evaluating to `False` elsewhere.

* **Parameters:**
  **members\_or\_member\_paths** –

  Either:

  * One or more members.
    In that case, all the hierarchy’s members are expected to be unique across all the levels of the hierarchy.
  * One or more member paths expressed as tuples of members starting from the top of the hierarchy.

### Example

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     columns=["Country", "City", "Price"],
...     data=[
...         ("Germany", "Berlin", 150.0),
...         ("Germany", "Hamburg", 120.0),
...         ("United Kingdom", "Bath", 240.0),
...         ("United Kingdom", "London", 270.0),
...     ],
... )
>>> table = session.read_pandas(
...     df, keys={"Country", "City"}, table_name="Example"
... )
>>> cube = session.create_cube(table, mode="manual")
>>> h = cube.hierarchies
>>> h["Geography"] = [table["Country"], table["City"]]
```

Condition on members:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Geography"].isin("Germany", "London")
h['Example', 'Geography'].isin('Germany', 'London')
```

Condition on member paths:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Geography"].isin(("Germany",), ("United Kingdom", "Bath"))
h['Example', 'Geography'].isin(('Germany',), ('United Kingdom', 'Bath'))
```

Members and member paths cannot be mixed:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Geography"].isin("Germany", ("United Kingdom", "Bath"))
Traceback (most recent call last):
    ...
ValueError: Expected either only members or only member paths but both were mixed: `('Germany', ('United Kingdom', 'Bath'))`.
```

Conditions on single members are normalized to equality conditions:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Geography"].isin("Germany")
h['Example', 'Geography'] == 'Germany'
```
