NameError: name 'csv' is not defined

Hi,

Midway through assignment, an earlier cell that was executing alright now raises error - at a point where I am yet to touch the code. Please see attached.

Any help please?

Hi @kea

Make sure that you run an import libraries cell as you import library (import csv) which used in read an file with extension ‘.csv’ with separator is (delimiter) ‘,’

Cheers!
Abdelrahman

Hi AbdelRhaman,

Thanks for your reply.
The libraries are imported in the first code cell, which I have of course run.

make sure from it … and also there are an library imported called csv (import csv) are this library exist in the import libraries cell ?

Thanks!
Abdelrahman

The “import csv” command is in the 1st code cell (please see attached). I have run it, it posed no problem in earlier runs, I have completed some “GRADED FUNCTIONS” way below that without problem. Then suddenly the above.

Personally it is the first time to face this arrow


I think it like check point (it mean that the first line is only that run )so you can try copy the import libraries from this cell and make a new cell and run the code

also make sure you didn’t change the indentation of the function parse_data_from_file

No I haven’t changed any indentation. Regarding your suggestion, changing stuff outside of “### START CODE HERE” and “### END CODE HERE” in the GRADED FUNCTIONS before submission, wouldn’t that affect the marking please?

this comment (### START CODE HERE , and ### END CODE HERE )only not affected but there are comments like # GRADED FUNCTION: … is necessary for auto grader

please don’t change it also


what is this arrow is it discard ?

That arrow appears at the beginning of all code cells, including succesfully executed ones (at least in my notebook).

The blue arrow that indicates currently executing lines appears inside the code cell/box, not outside please.

ok if the error isn’t solved yet, I think that you have an issue in your lab assignment to get a fresh assignment from scratch, please doing these steps file → open → select running assignment and doing shutdown and select all file and delete it → after that select help

like this image and choose →
image

Cheers!
Abdelrahman

try this and tell me what happened ?

I’ll give that a try.

Many thanks.

Problem solved with new notebook from scratch, thank you.

I am happy to hear that . Have a nice time @kea

Cheers,
Abdelrahman

Thanks, you too :slight_smile: