title: How to map closest place by lat-long from one-to-many
body: <p>Here's my code</p>
  <pre><code>import pandas as pd
  import numpy as np
  from sklearn.neighbors import BallTree, DistanceMetric
  
  # df1
  N = 2000
  df1 = pd.DataFrame({'name': 'name' + pd.RangeIndex(1, N+1).astype(str),
                      'lat': np.random.uniform(30, 65, N),
                      'lon': np.random.uniform(-150, -70, N)})
  
  
  # df2
  N = 25000
  df2 = pd.DataFrame({'sitename': 'site' + pd.RangeIndex(1, N+1).astype(str),
                      'lat': np.random.uniform(30, 65, N),
                      'lon': np.random.uniform(-150, -70, N)})
  
  
  # bts
  coords = np.radians(df1[['lat', 'lon']])
  dist = DistanceMetric.get_metric('haversine')
  tree = BallTree(coords, metric=dist)
  
  # airport_hostpital_1
  coords = np.radians(df2[['lat', 'lon']])
  distances, indices = tree.query(coords, k=1)
  
  df1['sitename'] = df2.iloc[indices.ravel()]['sitename'].values
  </code></pre>
  <p>Here's my output</p>
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-4-7d20f0c5d9d7&gt; in &lt;module&gt;
       24 distances, indices = tree.query(coords, k=1)
       25 
  ---&gt; 26 df1['sitename'] = df2.iloc[indices.ravel()]['sitename'].values
  
  ValueError: Length of values (25000) does not match length of index (2000)
  
  </code></pre>
  <p>My Expected output</p>
  <pre><code>    sitename    lat         lon             name
  0   site1       46.079246   -105.782183     name1209
  1   site2       49.243516   -95.104086      name1091
  2   site3       63.956400   -89.549558      name91
  </code></pre>