Hi I need to write a function knnOutliers(v, k, t) that takes a list argument v (which contain a list of points, where each point is a tuple containing two real-valued numbers), an integer argument k (corresponding to the number of neighbours of interest) and a positive real-valued argument t (specifying the threshold used to test whether a point is an outlier), and returns the list of indexes of the outlier points (if any) in the data sequence v. We can assume that k≥1, and that there are at least k+1 points in v. If our output list contains multiple output indexes, the indexes should appear in increasing order (see the third example below). If no outliers are detected, the function should return an empty list. We need to calculate the Euclidean distance between two points and sort the numbers using sort () :)). Thank you!!
Here is an example :
>>> print(knnOutliers([(2.0,2.1),(2.1,2.0),(2.0,2.0),(4.0,4.0),(4.1,4.2),(4.2,4.1),(3.1,2.9),(3.0,3.0)], 2, 1.0))