openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

Issue in line "document_section = df.loc[section_index]" of Question_answering_using_embeddings.ipynb

Open devmuhammadasad opened this issue 2 years ago • 1 comments
trafficstars

This is my first issue on Github so please ignore if I make any mistakes. I am trying to run Question_answering_using_embeddings.ipynb and this line "document_section = df.loc[section_index]" is causing an error.

Error: File "C:\Python310\lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc raise KeyError(key) from err KeyError: 'Summary'

Please suggests me a solution.

Link: https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb

devmuhammadasad avatar Jan 27 '23 14:01 devmuhammadasad

Check if the data frame if loading. Step one describes how to load the data frame. See if the following code from step 1 is running successfully and loading the data frame.

df = pd.read_csv('https://cdn.openai.com/API/examples/data/olympics_sections_text.csv') df = df.set_index(["title", "heading"]) print(f"{len(df)} rows in the data.") df.sample(5)

adityaparsai avatar Jan 29 '23 18:01 adityaparsai