<p dir="auto">Right now DictVectorizer is unable to handle features that have more than one value per key, such as:</p>
<p dir="auto">{'a': ['b','c'], 'd': 'e'}</p>
<p dir="auto">It would be great to simply encode a=b and a=c as the names of these features and 'just work.'</p>
<h4 dir="auto">Describe the bug</h4>

<ol dir="auto">
<li>A BallTree is created using a set of points that include duplicate values, representing different objects in the same spatial position;</li>
<li>The tree is queried using a second set of points, to determine the distance to the first closest neighbor;</li>
<li>Using the distances as radius, the tree is queried to obtain all the indexes from the first set of points that are closest neighbours with the second set. In situations where 2 or more key points have the same distance and are closest to a query point, I want to obtain all key points indexes.</li>
<li>However probably due to rounding errors some key indexes will not appear in the query_radius output.</li>
</ol>
<h4 dir="auto">Steps/Code to Reproduce</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="keys = np.array([[0.55039766, 0.84536002],
                 [0.55039766, 0.84536002],
                 [0.61324973, 0.05385278],
                 [0.61324973, 0.05385278],
                 [0.61324973, 0.05385278],
                 [0.54551389, 0.9451975 ],
                 [0.54551389, 0.9451975 ],
                 [0.76230722, 0.83559768],
                 [0.76230722, 0.83559768],
                 [0.78700191, 0.61089515],
                 [0.78700191, 0.61089515]])

tree = BallTree(keys, metric='l2', leaf_size=5)    

query = np.array([[0.5488135 , 0.71518937],
                  [0.60276338, 0.54488318],
                  [0.4236548 , 0.64589411],
                  [0.43758721, 0.891773  ],
                  [0.96366276, 0.38344152],
                  [0.79172504, 0.52889492],
                  [0.56804456, 0.92559664],
                  [0.07103606, 0.0871293 ],
                  [0.0202184 , 0.83261985],
                  [0.77815675, 0.87001215]])

distance, index = tree.query(query, k=1)

result = tree.query_radius(query, r=distance.ravel())"><pre class="notranslate"><code class="notranslate">keys = np.array([[0.55039766, 0.84536002],
                 [0.55039766, 0.84536002],
                 [0.61324973, 0.05385278],
                 [0.61324973, 0.05385278],
                 [0.61324973, 0.05385278],
                 [0.54551389, 0.9451975 ],
                 [0.54551389, 0.9451975 ],
                 [0.76230722, 0.83559768],
                 [0.76230722, 0.83559768],
                 [0.78700191, 0.61089515],
                 [0.78700191, 0.61089515]])

tree = BallTree(keys, metric='l2', leaf_size=5)    

query = np.array([[0.5488135 , 0.71518937],
                  [0.60276338, 0.54488318],
                  [0.4236548 , 0.64589411],
                  [0.43758721, 0.891773  ],
                  [0.96366276, 0.38344152],
                  [0.79172504, 0.52889492],
                  [0.56804456, 0.92559664],
                  [0.07103606, 0.0871293 ],
                  [0.0202184 , 0.83261985],
                  [0.77815675, 0.87001215]])

distance, index = tree.query(query, k=1)

result = tree.query_radius(query, r=distance.ravel())
</code></pre></div>
<h4 dir="auto">Expected Results</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="array([array([1, 0]), 
       array([10,  9]), 
       array([1, 0]), 
       array([5, 6]),
       array([10,  9]), 
       array([10,  9]), 
       array([5, 6]), 
       array([2, 3, 4]),
       array([1, 0]), 
       array([7, 8])], dtype=object)"><pre class="notranslate"><code class="notranslate">array([array([1, 0]), 
       array([10,  9]), 
       array([1, 0]), 
       array([5, 6]),
       array([10,  9]), 
       array([10,  9]), 
       array([5, 6]), 
       array([2, 3, 4]),
       array([1, 0]), 
       array([7, 8])], dtype=object)
</code></pre></div>
<h4 dir="auto">Actual Results</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="array([array([], dtype=int64), 
       array([10,  9]), 
       array([1, 0]),
       array([5, 6]), 
       array([10,  9]), 
       array([10,  9]),
       array([], dtype=int64), 
       array([2, 3, 4]), 
       array([1, 0]),
       array([], dtype=int64)], dtype=object)"><pre class="notranslate"><code class="notranslate">array([array([], dtype=int64), 
       array([10,  9]), 
       array([1, 0]),
       array([5, 6]), 
       array([10,  9]), 
       array([10,  9]),
       array([], dtype=int64), 
       array([2, 3, 4]), 
       array([1, 0]),
       array([], dtype=int64)], dtype=object)
</code></pre></div>
<h4 dir="auto">Versions</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="System:
    python: 3.6.9 (default, Jul 17 2020, 12:50:27)  [GCC 8.4.0]
executable: /usr/bin/python3
   machine: Linux-4.19.104+-x86_64-with-Ubuntu-18.04-bionic

Python dependencies:
       pip: 19.3.1
setuptools: 49.2.0
   sklearn: 0.22.2.post1
     numpy: 1.18.5
     scipy: 1.4.1
    Cython: 0.29.21
    pandas: 1.0.5
matplotlib: 3.2.2
    joblib: 0.16.0

Built with OpenMP: True"><pre class="notranslate"><code class="notranslate">System:
    python: 3.6.9 (default, Jul 17 2020, 12:50:27)  [GCC 8.4.0]
executable: /usr/bin/python3
   machine: Linux-4.19.104+-x86_64-with-Ubuntu-18.04-bionic

Python dependencies:
       pip: 19.3.1
setuptools: 49.2.0
   sklearn: 0.22.2.post1
     numpy: 1.18.5
     scipy: 1.4.1
    Cython: 0.29.21
    pandas: 1.0.5
matplotlib: 3.2.2
    joblib: 0.16.0

Built with OpenMP: True
</code></pre></div>