Files
lancedb/docs/web/integrations/data/pandas_and_pyarrow.mdx
Brendan Clement 758f738b8c docs: complete ingestion, search and integration examples (#4533)
This PR is part of the documentation revamp. Once the full set of PRs is
merged, we’ll publish the combined site to staging for review before
updating docs.lancedb.com.

Ingestion, search and integration examples are incomplete or
inconsistent across languages, and some guidance misstates SDK behavior.

This brings the guides and their example sources together. It includes
complete Python, TypeScript and Rust workflows, isolated provider and
reranker examples, the Superlinked corrections, and guidance on retries
that can duplicate writes.

Stacked on #4491. Each MDX file has one PR owner. Rebase onto main after
#4491 is squash-merged.

Local assembly, Mint validation and link checks pass. Example code is
unchanged from the previously validated package. Publication stays held
through integration.
2026-10-15 14:54:08 -07:00

53 lines
1.6 KiB
Plaintext

---
title: "Pandas and PyArrow"
sidebarTitle: "Pandas & PyArrow"
availability:
oss: available
enterprise: available
summary: >-
DataFrames go into `create_table` and come back from query results the same
way for local and deployment tables.
---
import {
PyPlatformsPandasAsyncExample,
PyPlatformsPandasCreateTable,
PyPlatformsPandasImports,
PyPlatformsPandasVectorSearch,
} from '/snippets/integrations.mdx';
Because Lance is built on top of [Apache Arrow](https://arrow.apache.org/),
LanceDB fits naturally into Pandas-first workflows. You can ingest a `DataFrame`,
query it with LanceDB's vector operators, and keep working in Pandas without any glue code.
## Create a dataset {#create-a-dataset}
Start by importing LanceDB alongside your usual Pandas utilities and connect to a temporary database.
<CodeBlock filename="Python" language="Python" icon="python">
{PyPlatformsPandasImports}
</CodeBlock>
Use the familiar `pd.DataFrame` API to prepare your rows, then pass the entire frame to `db.create_table`.
<CodeBlock filename="Python" language="Python" icon="python">
{PyPlatformsPandasCreateTable}
</CodeBlock>
## Vector search {#vector-search}
Queries can return Pandas frames as well, so you can immediately inspect the results or pipe them into downstream analytics.
<CodeBlock filename="Python" language="Python" icon="python">
{PyPlatformsPandasVectorSearch}
</CodeBlock>
## Async API {#async-api}
For web services or background jobs that already rely on `asyncio`, use the asynchronous helpers to keep everything non-blocking.
<CodeBlock filename="Python" language="Python" icon="python">
{PyPlatformsPandasAsyncExample}
</CodeBlock>