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

# Bodo DataFrames integrations

> Integrate with Bodo DataFrames using LangChain Python.

[Bodo DataFrames](https://github.com/bodo-ai/Bodo) is a high performance DataFrame library
for large scale Python data processing and drop-in replacement for Pandas; simply replace:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import pandas as pd
```

with:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import bodo.pandas as pd
```

to automatically scale and accelerate Pandas workloads.
Since Bodo DataFrames is compatible with Pandas, it is an ideal target for LLM code generation
that's easy to verify, efficient, and scalable beyond the typical limitations of Pandas.

Our integration package provides a toolkit for asking agents questions about large datasets
using Bodo DataFrames for efficiency and scalability.

Under the hood, Bodo DataFrames uses lazy evaluation to optimize sequences of Pandas operations,
streams data through operators to enable processing larger-than-memory datasets, and
leverages MPI-based high-performance computing technology for efficient parallel execution that can
easily scale from laptop to large cluster.

## Installation and setup

```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
pip install -U langchain_bodo
```

## Toolkit

The [langchain-bodo package](https://pypi.org/project/langchain-bodo/) provides functionality for creating agents that can answer questions about large datasets using Bodo DataFrames.
See the [Bodo DataFrames tools page](/oss/python/integrations/tools/bodo) for more detailed usage examples.

**NOTE: This feature uses the `Python` agent under the hood, which executes LLM generated Python code - this can be bad if the LLM generated Python code is harmful. Use cautiously.**

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_bodo import create_bodo_dataframes_agent
```

### Usage example

Before running the code below, copy the [titanic dataset](https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv)
and save locally as `titanic.csv`.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import bodo.pandas as pd
from langchain_openai import OpenAI

df = pd.read_csv("titanic.csv")
agent = create_bodo_dataframes_agent(
    OpenAI(temperature=0), df, verbose=True, allow_dangerous_code=True
)
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
agent.invoke("how many rows are there?")
```

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
> Entering new AgentExecutor chain...
Thought: I can use the len() function to get the number of rows in the dataframe.
Action: python_repl_ast
Action Input: len(df)891891 is the number of rows in the dataframe.
Final Answer: 891

> Finished chain.
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{'input': 'how many rows are there?', 'output': '891'}
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/bodo.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
