if y shape is ( 1600 , 1 ) then my code took about 66 sec
and if my y shape is ( 1600, ) then it took 37 s why is this thing is happening here is my code:-https://ide.codingblocks.com/s/223667
Time based query
Hey @Jan19LPN0013, time complexity of both the cases will be nearly same, the difference which you are observing is due to the line (y_-y[i]), when you pass y of shape (1600,1) then whenever you used, (y_-y[i]), the first step is to broadcase y_ into shape (1,). So everywhere this line of code is present, numpy first, has to broadcast it, whereas it does not need to do so in case of y having shape (1600,). This is the reason you are getting differences in time taken by the code.
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. 