LanceDB-2.py
· 332 B · Python
原始檔案
import lancedb
uri = "data/sample-lancedb"
db = lancedb.connect(uri)
table = db.create_table("my_table",
data=[{"vector": [3.1, 4.1], "item": "foo", "price": 10.0},
{"vector": [5.9, 26.5], "item": "bar", "price": 20.0}])
result = table.search([100, 100]).limit(2).to_pandas()
1 | import lancedb |
2 | |
3 | uri = "data/sample-lancedb" |
4 | db = lancedb.connect(uri) |
5 | table = db.create_table("my_table", |
6 | data=[{"vector": [3.1, 4.1], "item": "foo", "price": 10.0}, |
7 | {"vector": [5.9, 26.5], "item": "bar", "price": 20.0}]) |
8 | result = table.search([100, 100]).limit(2).to_pandas() |