BaşlayınÜcretsiz Başlayın

Namespaces

Namespaces are used to separate vectors within a single index, allowing targeted queries and minimizing the number of scanned records.

In this exercise, you'll practice ingesting vectors into different namespaces within the 'datacamp-index' Pinecone index. You'll need to connect to the index, upsert vectors into different namespaces, and check the updated metrics of the index.

Bu egzersiz

Vector Databases for Embeddings with Pinecone

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Initialize the Pinecone connection with your API key.
  • Upsert the vectors in vector_set1 into the namespace namespace1.
  • Upsert the vectors in vector_set2 into the namespace namespace2.
  • Print the index's descriptive statistics.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Initialize the Pinecone client with your API key
pc = Pinecone(api_key="____")
index = pc.Index('datacamp-index')

# Upsert vector_set1 to namespace1
____(
  vectors=vector_set1,
  ____
)

# Upsert vector_set2 to namespace2
____(
  vectors=vector_set2,
  ____
)

# Print the index statistics
____
Kodu Düzenle ve Çalıştır