# C2\_W1\_Assignment jax.numpy

**URL:** <https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105>\
**Category:** Calculus for Machine Learning and Data Science\
**Tags:** week-module-1\
**Created:** [June 2, 2025, 2:31pm UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105 "2025-06-02T14:31:23Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 2, 2025, 2:31pm UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/1 "2025-06-02T14:31:23Z")

</div>

Good evening everyone,

_{mentor edit: notebook link removed}_

I have converted the df into jax.numpy

np.array().astype(‘float32’).

Yet the grader returns 0% and i have this feedback:

There was a problem compiling the code from your notebook. Details:  
Value ‘\<function L\_of\_omega\_array at 0x7fbad5ff1830\>’ with dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX.

I am at my wit end.

If someone has an idea…

Thanks in advance

---

<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:** [June 2, 2025, 3:15pm UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/2 "2025-06-02T15:15:20Z")

</div>

1. Please do not share your code on the forum. That’s not allowed by the Code of Conduct.

2. Direct links to your private notebook are not supported. It leads to the user’s own notebook, not yours.

3. You do not need to add that import statement, it was already provided in the first cell in the notebook, in Section 2.1.  
Every time you open a notebook, you must run all of the cells starting from the top. This is how the assets are imported and the workspace is created.

The issue in your code is probably where you first create the prices\_B values, by using a the “df” dataframe reference.

---

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 3, 2025, 1:50am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/3 "2025-06-03T01:50:31Z")

</div>

When I ask for the whole workbook to be graded, i received 0 mark. When i insert # grade-up-to-here to only have the first question graded, i received the 30% mark attached to the first question.

---

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 3, 2025, 1:55am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/4 "2025-06-03T01:55:57Z")

</div>

@TMosh, I have MPed you a screenshot with the grader at 30% when i only require marking for the first question

[edit: problem solved]

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 3, 2025, 2:05am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/5 "2025-06-03T02:05:41Z")

</div>

So that means there is a bug later in the notebook. Do you still get the same error that you are showing in your first post on this thread?

---

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 3, 2025, 2:07am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/6 "2025-06-03T02:07:18Z")

</div>

i have simply inserted # grade-up-to-here before the last line of code. It worked.  
I have also download a fresh notebook but to no avail.  
The only thing that has worked was inserting # grade-up-to-here.  
The autograder really has a problem

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 3, 2025, 2:10am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/7 "2025-06-03T02:10:12Z")

</div>

The grader works fine for me. The theory would be that there is a bug in your code later in the notebook. Do you still get the error about the type of `L_of_omega_array`?

> [@groschat](#):
>
> Value ‘\<function L\_of\_omega\_array at 0x7fbad5ff1830\>’ with dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX.

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 3, 2025, 2:11am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/8 "2025-06-03T02:11:42Z")

</div>

It looks like you are referencing a function as if it is an array.

---

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 3, 2025, 2:12am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/9 "2025-06-03T02:12:19Z")

</div>

Thank you Paul, it works as long as I insert # grade-up-to-here. Got 100%

---

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 3, 2025, 2:14am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/10 "2025-06-03T02:14:04Z")

</div>

yes indeed additonally in the last question i have called L\_of\_omega\_array instead of L\_of\_omega. Maybe this mistake somewhat has interfered with the code above

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 3, 2025, 2:16am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/11 "2025-06-03T02:16:10Z")

</div>

So are you saying that everything works now? That you found the bug in your code?

---

<div class="post-metadata">

**Author:** ![groschat](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@groschat](https://community.deeplearning.ai/u/groschat)\
**Post date:** [June 3, 2025, 2:29am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/12 "2025-06-03T02:29:59Z")

</div>

Yes. For some reason, the error in question 4 has affected other part of the notebook. That’s why it worked when I inserted #grade up to here as only the 3 first questions were graded

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 3, 2025, 2:38am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/13 "2025-06-03T02:38:02Z")

</div>

If there is a runtime error anyplace in the graded parts of the notebook, then you get 0 points for everything. For example if you have exception like the one you showed above, then the grader cannot complete its execution, which is why you end up with 0 points for everything.

---

<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:** [June 3, 2025, 2:51am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/14 "2025-06-03T02:51:37Z")

</div>

Note that most courses do not support the “Grade Up To Here” directive.  
It can give very confusing results.

---

<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:** [June 3, 2025, 2:52am UTC](https://community.deeplearning.ai/t/c2-w1-assignment-jax-numpy/826105/15 "2025-06-03T02:52:13Z")

</div>

And “#grade up to here” should never be required to pass any assignment.

I strenuously recommend not using “#grade up to here”. It causes far more headaches than it has ever solved.
