> ## 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.

# Table.query()

> Table.query(\
>
>     *\*columns*: [Column](./atoti.Column#atoti.Column),\
>
>     *filter*: TableQueryFilterCondition | [None](https://docs.python.org/3/builtins/constants.html#None) = `None`,\
>
>     *max\_rows*: PositiveInt = `2147483646`,\
>
>     *timeout*: Duration = `datetime.timedelta(seconds=30)`,\
>
> ) → pd.DataFrame

Query the table to retrieve some of its rows.

If the table has more than *max\_rows* rows matching *filter*, the set of returned rows is unspecified and can change from one call to another.

As opposed to [`head()`](./atoti.Table.head#atoti.Table.head), the returned DataFrame will not be indexed by the table’s [`keys`](./atoti.Table.keys#atoti.Table.keys) since *columns* may lack some of them.

### Parameters

#### *\*columns*

The columns to query.
If empty, all the columns of the table will be queried.

#### *filter*

The filtering condition.
Only rows matching this condition will be returned.

#### *max\_rows*

The maximum number of rows to return.

#### *timeout*

The duration the query execution can take before being aborted.

***

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     columns=["Continent", "Country", "Currency", "Price"],
...     data=[
...         ("Europe", "France", "EUR", 200.0),
...         ("Europe", "Germany", "EUR", 150.0),
...         ("Europe", "United Kingdom", "GBP", 120.0),
...         ("America", "United states", "USD", 240.0),
...         ("America", "Mexico", "MXN", 270.0),
...     ],
... )
>>> table = session.read_pandas(
...     df,
...     keys={"Continent", "Country", "Currency"},
...     table_name="Prices",
... )
>>> result = table.query(filter=table["Price"] >= 200)
>>> result.set_index(list(table.keys)).sort_index()
                                  Price
Continent Country       Currency
America   Mexico        MXN       270.0
          United states USD       240.0
Europe    France        EUR       200.0
```
