what should i do i just need a little help
Hi @abdallagamaljimmy, welcome to our community!
An error traceback should start from the word “Traceback”. Please share the whole error traceback.
Thanks.
Raymond
Hello @abdallagamaljimmy,
We have this error when we use subscript on an integer object such as
However, subscript can be used on a numpy array like:
From the traceback, subscript is used on these variables dj_dw
, x
, y
, and x[i]
. Now, to debug it yourself, you need to first identify which one is an array and which one is not by printing the type of each of them right before the erroneous line. For example, print(type(dj_dw))
will tell you the type of dj_dw
.
As long as any one of them does not show itself as a numpy array nor a list, it is a cause of the problem and there can be more than one problematic variable, so please test all four of them.
Another piece of information you may want to take into consideration is this description because it tells you the expected data type of each variable and we should stick to it.
Good luck.
Raymond
thanks a lot for this help lot
I am happy to hear that I hope this particular error won’t ever bother you again in your future machine learning work
Raymond