# Module-2 chart generation practice lab getting error with new prompt

**URL:** <https://community.deeplearning.ai/t/module-2-chart-generation-practice-lab-getting-error-with-new-prompt/895436>\
**Category:** Agentic AI\
**Tags:** week-module-2, dl-ai-learning-platform\
**Created:** [October 1, 2026, 9:43pm UTC](https://community.deeplearning.ai/t/module-2-chart-generation-practice-lab-getting-error-with-new-prompt/895436 "2026-10-01T21:43:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mailprakashjha](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@mailprakashjha](https://community.deeplearning.ai/u/mailprakashjha)\
**Post date:** [October 1, 2026, 9:43pm UTC](https://community.deeplearning.ai/t/module-2-chart-generation-practice-lab-getting-error-with-new-prompt/895436/1 "2026-10-01T21:43:12Z")

</div>

after changing the user prompt to plot chart for coffee sales by time , getting error : module ‘pandas’ has no attribute ‘np’

**code** :

user\_instructions=“Create a plot comparing Q1 coffee sale time slot of [5am -11 am, 11am -3 pm, 3 pm -5 pm , 5pm -12 am] in 2024 and 2025 using the data in coffee\_sales.csv.” # write your instruction here  
generation\_model=“gpt-4o-mini”  
reflection\_model=“o4-mini”

# reflection\_model=“gpt-4.1” # alternative reflection model

image\_basename=“drink\_sale\_time1”

\_ = run\_workflow(  
dataset\_path=“coffee\_sales.csv”,  
user\_instructions=user\_instructions,  
generation\_model=generation\_model,  
reflection\_model=reflection\_model,  
image\_basename=image\_basename  
)

**error** : getting error while Step 2: Executing chart code (V1)…

**error description:**

```auto
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[18], line 9
      6 image_basename="drink_sale_time1"
      8 # Run the complete agentic workflow
----> 9 _ = run_workflow(
     10 dataset_path="coffee_sales.csv",
     11 user_instructions=user_instructions,
     12 generation_model=generation_model,
     13 reflection_model=reflection_model,
     14 image_basename=image_basename
     15 )

Cell In[16], line 41, in run_workflow(dataset_path, user_instructions, generation_model, reflection_model, image_basename)
     39 initial_code = match.group(1).strip()
     40 exec_globals = {"df": df}
---> 41 exec(initial_code, exec_globals)
     42 utils.print_html(out_v1, is_image=True, title="Generated Chart (V1)")
     44 # 3) Reflect on V1 (image + original code) to get feedback and refined code (V2)

File <string>:17

AttributeError: module 'pandas' has no attribute 'np'

```

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 1, 2026, 11:18pm UTC](https://community.deeplearning.ai/t/module-2-chart-generation-practice-lab-getting-error-with-new-prompt/895436/2 "2026-10-01T23:18:21Z")

</div>

Did you run the first cell in the notebook, where numpy is imported?

---

<div class="post-metadata">

**Author:** ![mailprakashjha](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@mailprakashjha](https://community.deeplearning.ai/u/mailprakashjha)\
**Post date:** [October 2, 2026, 7:21pm UTC](https://community.deeplearning.ai/t/module-2-chart-generation-practice-lab-getting-error-with-new-prompt/895436/3 "2026-10-02T19:21:26Z")

</div>

never mind . i see issue fixed now when i ran again. not sure what was the issue .

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 3, 2026, 4:00pm UTC](https://community.deeplearning.ai/t/module-2-chart-generation-practice-lab-getting-error-with-new-prompt/895436/4 "2026-10-03T16:00:17Z")

</div>

Remember that every time you open a notebook, you must run all of the cells starting from the top.

The platform remembers changes you have made to the cells, but it doesn’t remember the state of the workspace. So you have to re-create the workspace by running all of the cells.
