C3W4 'list' object has no attribute 'shape'

My function features_and_labels runs. But the labels reported from the test have the wrong shape: (1, 5, 3211) when it should be (5, 3211)

Please advise! Thanks!

===========================================================
Also, when running the function on the whole corpus I get:
AttributeError Traceback (most recent call last)

in
2 features, labels = features_and_labels(input_sequences, total_words)
3
----> 4 print(f"features have shape: {features.shape}“)
5 print(f"labels have shape: {labels.shape}”)

AttributeError: ‘list’ object has no attribute ‘shape’

The function features_and_labels should return a tuple / list of 2 nd-arrays of form features, one_hot_labels. The error pointed out by the unit test is valid.

AttributeError: ‘list’ object has no attribute ‘shape’ means that the features entry is a list and not an nd-array.

If this hint doesn’t help you solve the problem, please click my name and message your notebook as an attachment.