This page shows you how to get information about all of your indexes or about a specific index.To learn about the concepts related to indexes, see Indexes.
With the Python client, you can use the .names() helper function to iterate over the index names in the list_indexes() response, for example:
Python
Copy
Ask AI
from pinecone import Pinecone, ServerlessSpecpc = Pinecone(api_key="YOUR_API_KEY")index_name = "new-index"if index_name not in pc.list_indexes().names(): # Do something, such as create the index pc.create_index( name=index_name, dimension=1536, metric='cosine', spec=ServerlessSpec( cloud="aws", region="us-west-2" ) )