> ## 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.Table.query()

#### Table.query(\*columns, filter=None, max\_rows=2147483646, timeout=datetime.timedelta(seconds=30))

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** ([*Column*](./atoti.column#atoti.Column)) – The columns to query.
    If empty, all the columns of the table will be queried.
  * **filter** (*TableQueryFilterCondition* *|* *None*) – The filtering condition.
    Only rows matching this condition will be returned.
  * **max\_rows** (*PositiveInt*) – The maximum number of rows to return.
  * **timeout** (*Duration*) – The duration the query execution can take before being aborted.
* **Return type:**
  pd.DataFrame

### Example

```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
```
