# Operands could not be broadcast together with shapes (640,) (5,)

**URL:** <https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096>\
**Category:** Sequences, Time Series and Prediction\
**Tags:** week-module-2\
**Created:** [November 13, 2022, 9:07am UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096 "2022-11-13T09:07:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ichikawa0513](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@ichikawa0513](https://community.deeplearning.ai/u/ichikawa0513)\
**Post date:** [November 13, 2022, 9:07am UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/1 "2022-11-13T09:07:17Z")

</div>

about def windowed\_dataset my coding is below.  
why getting error??

[code removed - moderator]

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [November 13, 2022, 9:49am UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/2 "2022-11-13T09:49:05Z")

</div>

Shuffling should happen after you’re done with processing a single row i.e. dividing the row into input and output features.

---

<div class="post-metadata">

**Author:** ![ichikawa0513](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@ichikawa0513](https://community.deeplearning.ai/u/ichikawa0513)\
**Post date:** [November 13, 2022, 10:28am UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/3 "2022-11-13T10:28:34Z")

</div>

Balaji, thank you!!  
But I tried it. Although I got same error.  
coding is below.

[code removed - moderator]

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [November 13, 2022, 11:58am UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/4 "2022-11-13T11:58:37Z")

</div>

You have a map step after shuffle. Please remove it.

---

<div class="post-metadata">

**Author:** ![ichikawa0513](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@ichikawa0513](https://community.deeplearning.ai/u/ichikawa0513)\
**Post date:** [November 13, 2022, 9:34pm UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/5 "2022-11-13T21:34:26Z")

</div>

Thank you, Balaji!!  
I solved it!!

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [July 6, 2023, 11:26am UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/6 "2023-07-06T11:26:46Z")

</div>

hello Balaji in the windowed dataset assignment, after shuffling step there is split step for features and labels, which does require dataset.map. I am getting value error. I followed the ungraded lab instructions for this assignment

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 6, 2023, 2:03pm UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/7 "2023-07-06T14:03:00Z")

</div>

The `map` step is responsible for creating a tuple of `(features, label)`. If you are unable to find the mistake, please click my name and message your notebook as an attachment.

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [July 6, 2023, 2:19pm UTC](https://community.deeplearning.ai/t/operands-could-not-be-broadcast-together-with-shapes-640-5/230096/8 "2023-07-06T14:19:59Z")

</div>

hi Balaji, there was a mistake by me, I had interchange code in different line which I corrected. I have cleared the assignment. Thank you again for replying 🙂

Regards  
DP
