Skip to content

Commit a75ea93

Browse files
author
Gareth
authored
Reorder methods
1 parent 9fec072 commit a75ea93

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ index = pinecone.Index("example-index")
114114
index_stats_response = index.describe_index_stats()
115115
```
116116

117+
118+
## Upsert vectors
119+
120+
The following example upserts vectors to `example-index`.
121+
122+
```python
123+
import pinecone
124+
125+
pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
126+
index = pinecone.Index("example-index")
127+
128+
upsert_response = index.upsert(
129+
vectors=[
130+
("vec1", [0.1, 0.2, 0.3, 0.4], {"genre": "drama"}),
131+
("vec2", [0.2, 0.3, 0.4, 0.5], {"genre": "action"}),
132+
],
133+
namespace="example-namespace"
134+
)
135+
```
136+
117137
## Query an index
118138

119139
The following example queries the index `example-index` with metadata
@@ -182,25 +202,6 @@ update_response = index.update(
182202
)
183203
```
184204

185-
## Upsert vectors
186-
187-
The following example upserts vectors to `example-index`.
188-
189-
```python
190-
import pinecone
191-
192-
pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
193-
index = pinecone.Index("example-index")
194-
195-
upsert_response = index.upsert(
196-
vectors=[
197-
("vec1", [0.1, 0.2, 0.3, 0.4], {"genre": "drama"}),
198-
("vec2", [0.2, 0.3, 0.4, 0.5], {"genre": "action"}),
199-
],
200-
namespace="example-namespace"
201-
)
202-
```
203-
204205
## Create collection
205206

206207
The following example creates the collection `example-collection` from

0 commit comments

Comments
 (0)