# Module 2, ungraded lab

**URL:** <https://community.deeplearning.ai/t/module-2-ungraded-lab/895886>\
**Category:** Agentic AI\
**Tags:** week-module-2, coursera-platform\
**Created:** [October 26, 2026, 5:58pm UTC](https://community.deeplearning.ai/t/module-2-ungraded-lab/895886 "2026-10-26T17:58:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasanSHa](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@hasanSHa](https://community.deeplearning.ai/u/hasanSHa)\
**Post date:** [October 26, 2026, 5:58pm UTC](https://community.deeplearning.ai/t/module-2-ungraded-lab/895886/1 "2026-10-26T17:58:05Z")

</div>

3.2. Step 2 — Execute Code and Create Chart  
`---------------------------------------------------------------------------`  
`KeyError Traceback (most recent call last)`  
`File /usr/local/lib/python3.11/site-packages/pandas/core/indexes/base.py:3805, in Index.get_loc(self, key)`  
` 3804 try:`  
`-> 3805 return self._engine.get_loc(casted_key)`  
` 3806 except KeyError as err:`

`File index.pyx:167, in pandas._libs.index.IndexEngine.get_loc()`

`File index.pyx:196, in pandas._libs.index.IndexEngine.get_loc()`

`File pandas/_libs/hashtable_class_helper.pxi:7081, in pandas._libs.hashtable.PyObjectHashTable.get_item()`

`File pandas/_libs/hashtable_class_helper.pxi:7089, in pandas._libs.hashtable.PyObjectHashTable.get_item()`

`KeyError: 'quarter'`

`The above exception was the direct cause of the following exception:`

`KeyError Traceback (most recent call last)`  
`Cell In[11], line 7`  
` 5 utils.print_html(initial_code, title="Extracted Code to Execute")`  
` 6 exec_globals = {"df": df}`  
`----> 7 exec(initial_code, exec_globals)`  
` 9 # If code run successfully, the file chart_v1.png should have been generated`  
` 10 utils.print_html(`  
` 11 content="chart_v1.png",`  
` 12 title="Generated Chart (V1)",`  
` 13 is_image=True`  
` 14 )`

`File <string>:8`

`File /usr/local/lib/python3.11/site-packages/pandas/core/frame.py:4102, in DataFrame. __getitem__ (self, key)`  
` 4100 if self.columns.nlevels > 1:`  
` 4101 return self._getitem_multilevel(key)`  
`-> 4102 indexer = self.columns.get_loc(key)`  
` 4103 if is_integer(indexer):`  
` 4104 indexer = [indexer]`

`File /usr/local/lib/python3.11/site-packages/pandas/core/indexes/base.py:3812, in Index.get_loc(self, key)`  
` 3807 if isinstance(casted_key, slice) or (`  
` 3808 isinstance(casted_key, abc.Iterable)`  
` 3809 and any(isinstance(x, slice) for x in casted_key)`  
` 3810 ):`  
` 3811 raise InvalidIndexError(key)`  
`-> 3812 raise KeyError(key) from err`  
` 3813 except TypeError:`  
` 3814 # If we have a listlike key, _check_indexing_error will raise`  
` 3815 # InvalidIndexError. Otherwise we fall through and re-raise`  
` 3816 # the TypeError.`  
` 3817 self._check_indexing_error(key)`

`KeyError: 'quarter'`  
this error occur when I run the cell:

```auto
match = re.search(r"<execute_python>([\s\S]*?)</execute_python>", code_v1)
if match:
initial_code = match.group(1).strip()
utils.print_html(initial_code, title="Extracted Code to Execute")
exec_globals = {"df": df}
exec(initial_code, exec_globals)

utils.print_html(
content="chart_v1.png",
title="Generated Chart (V1)",
is_image=True
)

```

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/178017_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [October 26, 2026, 8:09pm UTC](https://community.deeplearning.ai/t/module-2-ungraded-lab/895886/2 "2026-10-26T20:09:35Z")

</div>

hi @hasanSHa

this issue is already reported to staff, kindly wait for their response. there is deprecation issue with model version.

appreciate your reporting this issue and patience, while staff working to resolve.

regards

dr. deepti

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [October 29, 2026, 3:07pm UTC](https://community.deeplearning.ai/t/module-2-ungraded-lab/895886/3 "2026-10-29T15:07:21Z")

</div>

Notebooks in the Agentic Course have been updated to newer gpt model, from **o4-mini** → **gpt-5-mini**

Currently, all notebooks are up and running 🙌

Happy Learning!

-- Lesly, DLAI
