M.V.L.R boston house price algorithm error?

What does the following error mean?
–>ValueError: setting an array element with a sequence.

Hi,
As the problem clearly state that you are trying to set an element of array with a sequence of values.
for e.g :
a = np.array([1,2,3,4]) # creating an array having single list of elements
a[0] = [8, 9] # trying to set first element with a list of 2 numbers

Here, the program will give you this error. Because, this array is supposed to take single elements, and you are providing multiple elements, so it will break it’s dimensions .

a[0] = 8 if you do this, this will work.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.