K Nearest Neighbour implementation

https://online.codingblocks.com/app/player/209779/content/201824/1283/lecture 2
at 9:20 in this video

d= dist(querypoint, X[i])

what is X[i]? is the array X filled with zeros? bcz when prateek bhaiya used print(x) there were no zeros in the data but rather 2 columns of floating point numbers, but then the function at the end returns if the query point belongs to class 0 or class 1
X[i[ is an array with 2 columns, how can we access its elements without giving the column number?

and please give an explanantion on how does the KNN work , we take values from 2 columns of X and try to predict which column the query point would belong to using a 1D array Y which gives the first half of X[i] a label 0 and the last half a label of 1? if possible please upload another video in the course for knn its very confusing as of now

X[i] is actually the values in X at ith index , hence you see those two floating values.

we check distances of the query point with each point in the data , and based on those distances , we see which is majority class to which it is closest to.
and based on that we decide which is our final output.

I hope this helps.

how do we label them? do we have to create an entirely new column in each array we are using knn on for labels like for the first array we make a column filled with all 0s, for the next array we add a column filled with 1s and so on?

which labelling are you referring too ?

labelling the two classes from which we will calculate the distance from (class 0 and class 1)

buddy those labels are provided in the data , your Y

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.