hello everyone according to staff update, the issue is resolved, try to launch the notebook again lassroom page, in case you still find same issue, please make sure to clear your kernel output, delete any browsing history, and try again.
Hi Deepti, yes I have tried all those things: restart the notebook, manually “restart and clear output” for Kernel and repeatedly running the cell from the start of the notebook to that session multiple times but to no avail. Please help resolve
can you make change to df code where astype(str) is used, instead of tuple, use square brackets for the first code line, do you still get the same error??
I am not sure how to edit the LLM generated code block to change the syntax but I added an additional code generation prompt line to specifically avoid this error. Then the generated code block no longer has this syntax error. Thanks for the pointer!
Hello TMosh! Thanks for recalling about this ungraded lab! - I get how frustrating it can be when the lab doesn’t run properly.
In this lab, remember that the LLM actually writes code that’s then executed to make the chart. Sometimes it doesn’t format the code correctly.
Try these quick fixes:
Run the cell again (often works on the second or third try).
Make a tiny change in your prompt or code so the LLM regenerates fresh output. (I, myself, am testing the generated code by the LLM in a colab notebook to test the result and so and how I can improve the prompt to get it working)
If it still fails, it’s likely the model just produced incorrect code — totally normal for some models. We’ll add a note about that in the lab. Thanks for catching this and helping us improve!
I’d also add this “kind of” warning in the prompt:
"remove/avoid the line that attempts to combine the date and year string, as the date column already contains the complete date information."
Key here is modifying the prompt to avoid type exception , we can instruct write a code in such way that we avoid type error - an did worked for me
while this is perfectly fine - I think we can modify the problematic code line ourself - use the model output extracted code string , correct it and store in same variable - this also works
Hello Lesly,
I put your “kind of” warning in the prompt and also told it: do not try to add together any Datetime strings. These two “kind of” warnings seemed to be enough to convince it of the nature of the code I required!
I’m newish to Python so I got chatgpt to interpret the error messages I was getting instead of a plot.
Cheers!