Csv.reader returning only a single 1-character string from iterator

Am missing something VERY basic about csv.reader

Here is my code:

And here is what prints:
row_count = 0 row is [‘.’]
row_count = 1 row is [‘/’]
row_count = 2 row is [‘d’]
row_count = 3 row is [‘a’]
row_count = 4 row is [‘t’]

In particular, row[1] is empty

Hello Philip,

Do not post any of the grader cell codes, it is against community guidelines.

Also your codes are incorrect.

it is clearly mentioned before the start code here that you should use filename as csvfile but you have used filename.

you added newline which is not required and in case you have edited that as it is outside the start code here.

  1. You should omit the first line as it contains the headers and not data points

here you need to skip the header with the correct code which you have not included.

for this it is clearly mentioned for rows you need to row[0] and for text(that means sentences) row[1]

returns an iterable that returns each row in every iteration. So the label can be accessed via row[0] and the text via row[1] by using remove_Stopwords function in each sentence in both rows as well sentence append function.

You complicated the codes for sentences by recalling it first with raw_sentence and then processed_sentence which was not required.

and kindly remove the codes from your comment. Click on the three dots and then select delete or select the edit option to remove the codes part of your comment.

Regards
DP

Code deleted. I had already figured it out and submitted corrected file. You were exactly right.

ok then close the thread by selecting appropriate comment or mentioning how the issue was resolved.

Regards
DP