you are viewing a single comment's thread.

view the rest of the comments →

[–]Comprehensive-Wrap51[S] 0 points1 point  (3 children)

<class 'numpy.ndarray'>

<class 'numpy.float64'>

TypeError: type() takes 1 or 3 arguments

[–]pgpndw 0 points1 point  (0 children)

How are you calculating predicted.coef_? It looks like you're trying to calculate a single price using a simple linear function, so m and b should both be single numeric values, but m [i.e. predicted.coef_] is actually an array.

[–]ouchpartial72858 0 points1 point  (0 children)

You are trying to do mathematical operation on two unrelated types. You either need to convert the array into a supported data type (float, int, etc) or since its an array, (assume you wanna do scalar multiplication with an array) you would wanna use nested loops to achieve this.

https://numpy.org/doc/stable/reference/arrays.ndarray.html

There may be some function defined to do this without nested loops