<jupyter_start><jupyter_text>**<NAME> **  **August 23, 2019** How to use KDTree to find nearest neighborReference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.KDTree.query.html<jupyter_code>from scipy import spatial
import numpy as np

x, y = np.mgrid[0:5, 10:15]
# Create the Tree
tree = spatial.KDTree(list(zip(x.ravel(), y.ravel())))
tree.data<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15288220551378445, 'fraction_numerical': 0.03007518796992481, 'mean_word_length': 6.2727272727272725, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '565917', 'license': 'MIT', 'n_tokens_mistral': 168, 'n_tokens_neox': 151, 'n_words': 31, 'path': 'Untitled.ipynb', 'repo_name': 'blaylockbk/Web-Homepage', 'size': '407'}