Week 1: Test Error on Exercise 2 Practice

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to: Sentiment with Deep Neural Networks | Coursera
  • Description (include relevant info but please do not post solution code or your entire notebook)

I got the following for exercise two test after implementing code

Output object does not have the correct type.
	Expected: 2.
	Got: 2.
Output object does not have the correct type.
	Expected: 3.
	Got: 3.
 2  Tests passed
 2  Tests failed

I solved it using np.max with a in-line loop that populates an array of all tweet lengths. Looks like it is working, not sure what I am missing

Figured it out! It was because it was a numpy.int64. I had to convert to regular int and test passed

1 Like