C4W2 Assignment Trouble

Hello all, I was quite happy and excited to get through C4W2 and learn this new concepts.
However, I am running into this type error.

TypeError: <lambda>() takes 1 positional argument but 2 were given

I do want to know what positional argument it is talking about from this cell.

Test your function with windows size of 1 and no shuffling

test_dataset = windowed_dataset(series_train, window_size, batch_size, shuffle_buffer_size)

Get the first batch of the test dataset

batch_of_features, batch_of_labels = next((iter(test_dataset)))

print(f"batch_of_features has type: {type(batch_of_features)}\n")
print(f"batch_of_labels has type: {type(batch_of_labels)}\n")
print(f"batch_of_features has shape: {batch_of_features.shape}\n")
print(f"batch_of_labels has shape: {batch_of_labels.shape}\n")
print(f"batch_of_features is equal to first five elements in the series: {np.allclose(batch_of_features.numpy().flatten(), series_train[:5])}\n")
print(f"batch_of_labels is equal to first five labels: {np.allclose(batch_of_labels.numpy(), series_train[1:6])}")

Can anyone please give me a hint or help?

Thanks, Anthony

This means that there is a lambda function that takes 1 parameter as an argument but you provided 2 when invoking it.


>>> add_one = lambda x : x + 1
>>> print(add_one(1, 2))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: <lambda>() takes 1 positional argument but 2 were given

As suggested by @balaji.ambresh please try examining the lambda function defined
Thanks and Regards,
Mayank Ghogale