Numpy Operations Problem Solution

What is the purpose of creating a dfo=np.zeros((npoints,1)) and why do we initialize a variable outside_poitns=0


We create an one d-array “dfo” ,so that initial values of distances from origin is 0. After calculating distance of each point, we then add it to this array. The outsidepoints variable stores the no of points which are outside the area of sphere.

1 Like

Actually it’s not necessary to do that. I didn’t do it that way