Linear Regression # Help needed please help me

Hi, I am quite stuck in the code of the Machine Learning Course 1 Week 2 Optional Lab: Multiple linear regression as the code is showing this problem when I entered the code on my Jupyter notebook it showed error : ( unsupported format string passed to numpy.ndarray.format )

Here is my screenshot :

I have two guesses what the problem might be:

  • Maybe you modified something in the compute_cost() function which makes it return the wrong data type, or the wrong shape.
  • Maybe your local installation has a different version of python or numpy, which caused a compatibility problem.

Do you get the expected results when you run the original notebook in the Coursera Labs environment?

I got the expected result when I ran the original notebook from coursera.The problem arise when I implemented on my own , even after copying the whole code. As for my Python its version is 3.9.17 and for Numpy its version is 1.24.3 . So can you please help me resolve it.

If you want to use the Coursera notebooks in your own environment, you need to use the same version of tools that Coursera provides.

Hello,

see if this post helps

Regards
DP