> ## 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()

<span id="atoti.Table.query" />

> Table.query(<br />
>     *\*columns*: [Column](./atoti.Column#atoti.Column),<br />
>     *filter*: TableQueryFilterCondition | [None](https://docs.python.org/3/library/constants.html#None) = `None`,<br />
>     *max\_rows*: PositiveInt = `2147483646`,<br />
>     *timeout*: Duration = `datetime.timedelta(seconds=30)`,<br />
> ) → 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

<h4 id="atoti.Table.query.columns">
  *\*columns*
</h4>

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

<h4 id="atoti.Table.query.filter">
  *filter*
</h4>

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

<h4 id="atoti.Table.query.max_rows">
  *max\_rows*
</h4>

The maximum number of rows to return.

<h4 id="atoti.Table.query.timeout">
  *timeout*
</h4>

The duration the query execution can take before being aborted.

***

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/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
```
