# Error kode C2W1

**URL:** <https://community.deeplearning.ai/t/error-kode-c2w1/712906>\
**Category:** Advanced Learning Algorithms\
**Tags:** week-module-1\
**Created:** [October 23, 2024, 5:43pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906 "2024-10-23T17:43:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![doraleonn](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@doraleonn](https://community.deeplearning.ai/u/doraleonn)\
**Post date:** [October 23, 2024, 5:43pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/1 "2024-10-23T17:43:28Z")

</div>

I’m working on programming assignments on neural-networks-for-binary-classification material, when I run the code a notification appears all tests are passed but when I try to submit my assignment it is rejected and I didn’t change the code just added some elements

---

<div class="post-metadata">

**Author:** ![wai\_yar\_aung111](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/wai_yar_aung111/32/98099_2.png) [@wai\_yar\_aung111](https://community.deeplearning.ai/u/wai_yar_aung111)\
**Post date:** [October 23, 2024, 6:00pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/2 "2024-10-23T18:00:33Z")

</div>

Hello @doraleonn

It seems like the issue is caused by an IndexError, where you’re trying to index a 1D array with two indices. This could happen if the shapes of `X` or `y` don’t match the expected format. Make sure `X` is 2D with shape `(num_samples, num_features)` and `y` is 1D with shape `(num_samples,)`. Also, check if any custom plotting or indexing might be causing the error. Try printing the shapes of your variables to ensure they align with the model’s input expectations. Let me know if you need further clarification!

---

<div class="post-metadata">

**Author:** ![doraleonn](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@doraleonn](https://community.deeplearning.ai/u/doraleonn)\
**Post date:** [October 23, 2024, 6:07pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/3 "2024-10-23T18:07:51Z")

</div>

thank you sir for the explanation, I will try again

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 23, 2024, 6:38pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/4 "2024-10-23T18:38:52Z")

</div>

@doraleonn, just a friendly reminder:

Posting solution code in a public topic goes against our Community Forum [Code of Conduct](https://community.deeplearning.ai/c/faq/code-of-conduct/392). It’s okay to share images of any error messages.

Please edit your post.

Here’s a guide on how to [edit a post](https://community.deeplearning.ai/c/community-programs/380).

---

<div class="post-metadata">

**Author:** ![doraleonn](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@doraleonn](https://community.deeplearning.ai/u/doraleonn)\
**Post date:** [October 23, 2024, 7:52pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/5 "2024-10-23T19:52:49Z")

</div>

thanks sir for your reminder

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 23, 2024, 8:10pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/7 "2024-10-23T20:10:16Z")

</div>

Closed on October 23, 2024, 8:10pm UTC



---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 23, 2024, 8:11pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/8 "2024-10-23T20:11:28Z")

</div>

Opened on October 23, 2024, 8:11pm UTC



---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 23, 2024, 8:11pm UTC](https://community.deeplearning.ai/t/error-kode-c2w1/712906/9 "2024-10-23T20:11:51Z")

</div>

I have re-opened this thread. I was mistaken about whether there was a duplicate thread.
