mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Pyupgrade to Python 3.9 (#4718)
* Pyupgrade to Python 3.9 * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -7,8 +7,9 @@ returns a list containing two data for each vector:
|
||||
1. the nearest vector
|
||||
2. distance between the vector and the nearest vector (float)
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
from typing import List, Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -33,7 +34,7 @@ def euclidean(input_a: np.ndarray, input_b: np.ndarray) -> float:
|
||||
|
||||
def similarity_search(
|
||||
dataset: np.ndarray, value_array: np.ndarray
|
||||
) -> List[List[Union[List[float], float]]]:
|
||||
) -> list[list[list[float] | float]]:
|
||||
"""
|
||||
:param dataset: Set containing the vectors. Should be ndarray.
|
||||
:param value_array: vector/vectors we want to know the nearest vector from dataset.
|
||||
|
Reference in New Issue
Block a user