openai-cookbook
openai-cookbook copied to clipboard
Issue in line "document_section = df.loc[section_index]" of Question_answering_using_embeddings.ipynb
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
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)