<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [2]: mi = pd.MultiIndex.from_product([[True, False], range(1, 10)])

In [3]: mi.get_loc((False, 1))
Out[3]: 9

In [4]: mi = pd.MultiIndex.from_product([[True, False], range(1, 10000)])

In [5]: mi.get_loc((False, 1))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-5-68f8698878ec&gt; in &lt;module&gt;()
----&gt; 1 mi.get_loc((False, 1))

/home/pietro/nobackup/repo/pandas/pandas/core/indexes/multi.py in get_loc(self, key, method)
   2134             key = _values_from_object(key)
   2135             key = tuple(map(_maybe_str_to_time_stamp, key, self.levels))
-&gt; 2136             return self._engine.get_loc(key)
   2137 
   2138         # -- partial selection or non-unique index

/home/pietro/nobackup/repo/pandas/pandas/_libs/index.pyx in pandas._libs.index.MultiIndexHashEngine.get_loc (pandas/_libs/index.c:15854)()

/home/pietro/nobackup/repo/pandas/pandas/_libs/index.pyx in pandas._libs.index.MultiIndexHashEngine.get_loc (pandas/_libs/index.c:15701)()

/home/pietro/nobackup/repo/pandas/pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.MultiIndexHashTable.get_item (pandas/_libs/hashtable.c:24621)()

/home/pietro/nobackup/repo/pandas/pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.MultiIndexHashTable.get_item (pandas/_libs/hashtable.c:24468)()

/home/pietro/nobackup/repo/pandas/pandas/core/indexes/multi.py in _hashed_indexing_key(self, key)
    819         key = tuple([f(k, stringify)
    820                      for k, stringify in zip(key, self._have_mixed_levels)])
--&gt; 821         return hash_tuple(key)
    822 
    823     @Appender(base._shared_docs['duplicated'] % _index_doc_kwargs)

/home/pietro/nobackup/repo/pandas/pandas/core/util/hashing.py in hash_tuple(val, encoding, hash_key)
    186               for v in val)
    187 
--&gt; 188     h = _combine_hash_arrays(hashes, len(val))[0]
    189 
    190     return h

/home/pietro/nobackup/repo/pandas/pandas/core/util/hashing.py in _combine_hash_arrays(arrays, num_items)
     31     &quot;&quot;&quot;
     32     try:
---&gt; 33         first = next(arrays)
     34     except StopIteration:
     35         return np.array([], dtype=np.uint64)

/home/pietro/nobackup/repo/pandas/pandas/core/util/hashing.py in &lt;genexpr&gt;(.0)
    184     &quot;&quot;&quot;
    185     hashes = (_hash_scalar(v, encoding=encoding, hash_key=hash_key)
--&gt; 186               for v in val)
    187 
    188     h = _combine_hash_arrays(hashes, len(val))[0]

/home/pietro/nobackup/repo/pandas/pandas/core/util/hashing.py in _hash_scalar(val, encoding, hash_key)
    330 
    331     return hash_array(vals, hash_key=hash_key, encoding=encoding,
--&gt; 332                       categorize=False)

/home/pietro/nobackup/repo/pandas/pandas/core/util/hashing.py in hash_array(vals, encoding, hash_key, categorize)
    290 
    291         try:
--&gt; 292             vals = hashing.hash_object_array(vals, hash_key, encoding)
    293         except TypeError:
    294             # we have mixed types

/home/pietro/nobackup/repo/pandas/pandas/_libs/hashing.pyx in pandas._libs.hashing.hash_object_array (pandas/_libs/hashing.c:1764)()

ValueError: Does not understand character buffer dtype format string ('?')

In [6]: mi = pd.MultiIndex.from_product([[1, 0], range(1, 10000)])

In [7]: mi.get_loc((1, 1))
Out[7]: 0
"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">mi</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>([[<span class="pl-c1">True</span>, <span class="pl-c1">False</span>], <span class="pl-en">range</span>(<span class="pl-c1">1</span>, <span class="pl-c1">10</span>)])

<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">get_loc</span>((<span class="pl-c1">False</span>, <span class="pl-c1">1</span>))
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]: <span class="pl-c1">9</span>

<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">mi</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>([[<span class="pl-c1">True</span>, <span class="pl-c1">False</span>], <span class="pl-en">range</span>(<span class="pl-c1">1</span>, <span class="pl-c1">10000</span>)])

<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">get_loc</span>((<span class="pl-c1">False</span>, <span class="pl-c1">1</span>))
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">ValueError</span>                                <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>)
<span class="pl-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">5</span><span class="pl-c1">-</span><span class="pl-c1">68</span><span class="pl-s1">f8698878ec</span><span class="pl-c1">&gt;</span> <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>()
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1</span> <span class="pl-s1">mi</span>.<span class="pl-en">get_loc</span>((<span class="pl-c1">False</span>, <span class="pl-c1">1</span>))

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">multi</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">get_loc</span>(<span class="pl-s1">self</span>, <span class="pl-s1">key</span>, <span class="pl-s1">method</span>)
   <span class="pl-c1">2134</span>             <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-en">_values_from_object</span>(<span class="pl-s1">key</span>)
   <span class="pl-c1">2135</span>             <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-en">tuple</span>(<span class="pl-en">map</span>(<span class="pl-s1">_maybe_str_to_time_stamp</span>, <span class="pl-s1">key</span>, <span class="pl-s1">self</span>.<span class="pl-s1">levels</span>))
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">2136</span>             <span class="pl-s1">return</span> <span class="pl-s1">self</span>.<span class="pl-s1">_engine</span>.<span class="pl-en">get_loc</span>(<span class="pl-s1">key</span>)
   <span class="pl-c1">2137</span> 
   <span class="pl-c1">2138</span>         <span class="pl-c"># -- partial selection or non-unique index</span>

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">index</span>.<span class="pl-s1">pyx</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">_libs</span>.<span class="pl-s1">index</span>.<span class="pl-v">MultiIndexHashEngine</span>.<span class="pl-en">get_loc</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">index</span>.<span class="pl-s1">c</span>:<span class="pl-c1">15854</span>)()

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">index</span>.<span class="pl-s1">pyx</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">_libs</span>.<span class="pl-s1">index</span>.<span class="pl-v">MultiIndexHashEngine</span>.<span class="pl-en">get_loc</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">index</span>.<span class="pl-s1">c</span>:<span class="pl-c1">15701</span>)()

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">hashtable_class_helper</span>.<span class="pl-s1">pxi</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">_libs</span>.<span class="pl-s1">hashtable</span>.<span class="pl-v">MultiIndexHashTable</span>.<span class="pl-en">get_item</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">hashtable</span>.<span class="pl-s1">c</span>:<span class="pl-c1">24621</span>)()

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">hashtable_class_helper</span>.<span class="pl-s1">pxi</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">_libs</span>.<span class="pl-s1">hashtable</span>.<span class="pl-v">MultiIndexHashTable</span>.<span class="pl-en">get_item</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">hashtable</span>.<span class="pl-s1">c</span>:<span class="pl-c1">24468</span>)()

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">multi</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_hashed_indexing_key</span>(<span class="pl-s1">self</span>, <span class="pl-s1">key</span>)
    <span class="pl-c1">819</span>         <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-en">tuple</span>([<span class="pl-en">f</span>(<span class="pl-s1">k</span>, <span class="pl-s1">stringify</span>)
    <span class="pl-c1">820</span>                      <span class="pl-k">for</span> <span class="pl-s1">k</span>, <span class="pl-s1">stringify</span> <span class="pl-c1">in</span> <span class="pl-en">zip</span>(<span class="pl-s1">key</span>, <span class="pl-s1">self</span>.<span class="pl-s1">_have_mixed_levels</span>)])
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">821</span>         <span class="pl-s1">return</span> <span class="pl-en">hash_tuple</span>(<span class="pl-s1">key</span>)
    <span class="pl-c1">822</span> 
    <span class="pl-c1">823</span>     @<span class="pl-v">Appender</span>(<span class="pl-s1">base</span>.<span class="pl-s1">_shared_docs</span>[<span class="pl-s">'duplicated'</span>] <span class="pl-c1">%</span> <span class="pl-s1">_index_doc_kwargs</span>)

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">util</span><span class="pl-c1">/</span><span class="pl-s1">hashing</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">hash_tuple</span>(<span class="pl-s1">val</span>, <span class="pl-s1">encoding</span>, <span class="pl-s1">hash_key</span>)
    <span class="pl-c1">186</span>               <span class="pl-k">for</span> <span class="pl-s1">v</span> <span class="pl-c1">in</span> <span class="pl-s1">val</span>)
    <span class="pl-c1">187</span> 
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">188</span>     <span class="pl-s1">h</span> <span class="pl-c1">=</span> <span class="pl-en">_combine_hash_arrays</span>(<span class="pl-s1">hashes</span>, <span class="pl-en">len</span>(<span class="pl-s1">val</span>))[<span class="pl-c1">0</span>]
    <span class="pl-c1">189</span> 
    <span class="pl-c1">190</span>     <span class="pl-s1">return</span> <span class="pl-s1">h</span>

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">util</span><span class="pl-c1">/</span><span class="pl-s1">hashing</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_combine_hash_arrays</span>(<span class="pl-s1">arrays</span>, <span class="pl-s1">num_items</span>)
     <span class="pl-c1">31</span>     <span class="pl-s">"""</span>
<span class="pl-s">     32     try:</span>
<span class="pl-s">---&gt; 33         first = next(arrays)</span>
<span class="pl-s">     34     except StopIteration:</span>
<span class="pl-s">     35         return np.array([], dtype=np.uint64)</span>
<span class="pl-s"></span>
<span class="pl-s">/home/pietro/nobackup/repo/pandas/pandas/core/util/hashing.py in &lt;genexpr&gt;(.0)</span>
<span class="pl-s">    184     """</span>
    <span class="pl-c1">185</span>     <span class="pl-s1">hashes</span> <span class="pl-c1">=</span> (<span class="pl-en">_hash_scalar</span>(<span class="pl-s1">v</span>, <span class="pl-s1">encoding</span><span class="pl-c1">=</span><span class="pl-s1">encoding</span>, <span class="pl-s1">hash_key</span><span class="pl-c1">=</span><span class="pl-s1">hash_key</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">186</span>               <span class="pl-k">for</span> <span class="pl-s1">v</span> <span class="pl-c1">in</span> <span class="pl-s1">val</span>)
    <span class="pl-c1">187</span> 
    <span class="pl-c1">188</span>     <span class="pl-s1">h</span> <span class="pl-c1">=</span> <span class="pl-en">_combine_hash_arrays</span>(<span class="pl-s1">hashes</span>, <span class="pl-en">len</span>(<span class="pl-s1">val</span>))[<span class="pl-c1">0</span>]

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">util</span><span class="pl-c1">/</span><span class="pl-s1">hashing</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_hash_scalar</span>(<span class="pl-s1">val</span>, <span class="pl-s1">encoding</span>, <span class="pl-s1">hash_key</span>)
    <span class="pl-c1">330</span> 
    <span class="pl-c1">331</span>     <span class="pl-k">return</span> <span class="pl-s1">hash_array</span>(<span class="pl-s1">vals</span>, <span class="pl-s1">hash_key</span><span class="pl-c1">=</span><span class="pl-s1">hash_key</span>, <span class="pl-s1">encoding</span><span class="pl-c1">=</span><span class="pl-s1">encoding</span>,
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">332</span>                       <span class="pl-s1">categorize</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">util</span><span class="pl-c1">/</span><span class="pl-s1">hashing</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">hash_array</span>(<span class="pl-s1">vals</span>, <span class="pl-s1">encoding</span>, <span class="pl-s1">hash_key</span>, <span class="pl-s1">categorize</span>)
    <span class="pl-c1">290</span> 
    <span class="pl-c1">291</span>         <span class="pl-k">try</span>:
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">292</span>             <span class="pl-s1">vals</span> <span class="pl-c1">=</span> <span class="pl-s1">hashing</span>.<span class="pl-en">hash_object_array</span>(<span class="pl-s1">vals</span>, <span class="pl-s1">hash_key</span>, <span class="pl-s1">encoding</span>)
    <span class="pl-c1">293</span>         <span class="pl-s1">except</span> <span class="pl-v">TypeError</span>:
    <span class="pl-c1">294</span>             <span class="pl-c"># we have mixed types</span>

<span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">pietro</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">hashing</span>.<span class="pl-s1">pyx</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">_libs</span>.<span class="pl-s1">hashing</span>.<span class="pl-en">hash_object_array</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">_libs</span><span class="pl-c1">/</span><span class="pl-s1">hashing</span>.<span class="pl-s1">c</span>:<span class="pl-c1">1764</span>)()

<span class="pl-v">ValueError</span>: <span class="pl-v">Does</span> <span class="pl-c1">not</span> <span class="pl-s1">understand</span> <span class="pl-s1">character</span> <span class="pl-s1">buffer</span> <span class="pl-s1">dtype</span> <span class="pl-s1">format</span> <span class="pl-en">string</span> (<span class="pl-s">'?'</span>)

<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-s1">mi</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>([[<span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-en">range</span>(<span class="pl-c1">1</span>, <span class="pl-c1">10000</span>)])

<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">get_loc</span>((<span class="pl-c1">1</span>, <span class="pl-c1">1</span>))
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]: <span class="pl-c1">0</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">The two engines should give the same result.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto"><code class="notranslate">Out[3]:</code></p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pandas-dev/pandas/commit/f745e52e168790bff06a55928c3491cdea389508/hovercard" href="https://github.com/pandas-dev/pandas/commit/f745e52e168790bff06a55928c3491cdea389508"><tt>f745e52</tt></a><br>
python: 3.5.3.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.9.0-3-amd64<br>
machine: x86_64<br>
processor:<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: it_IT.UTF-8<br>
LOCALE: it_IT.UTF-8</p>
<p dir="auto">pandas: 0.22.0.dev0+241.gf745e52e1.dirty<br>
pytest: 3.2.3<br>
pip: 9.0.1<br>
setuptools: 36.7.0<br>
Cython: 0.25.2<br>
numpy: 1.12.1<br>
scipy: 0.19.0<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.2.1<br>
sphinx: 1.5.6<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.0dev<br>
tables: 3.3.0<br>
numexpr: 2.6.1<br>
feather: 0.3.1<br>
matplotlib: 2.0.0<br>
openpyxl: None<br>
xlrd: 1.0.0<br>
xlwt: 1.1.2<br>
xlsxwriter: 0.9.6<br>
lxml: None<br>
bs4: 4.5.3<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.0.15<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: 0.2.1</p>
</details>
<p dir="auto">Now that pip 19 is out, we can attempt to re-add pyproject.toml</p>
<hr>
<p dir="auto">The release of pip version 10 and the presence of a <code class="notranslate">pyproject.toml</code> in our latest released versions gives problems for installing pandas in the following cases:</p>
<p dir="auto"><strong>Problem with installing pandas for Python 3.4</strong></p>
<ul dir="auto">
<li>You get the error <em>"Double requirement given: numpy ..."</em></li>
<li>The reason for this error is that pandas 0.21-0.22 no longer supports Python 3.4, and thus no longer distributes binary wheels for Python 3.4. Therefore, pip tries to install pandas from source, and this is what now started to fail with Pip version 10.</li>
<li><strong>Solution</strong>:
<ul dir="auto">
<li>
<p dir="auto">Install an older version of pandas</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install pandas&lt;0.21"><pre class="notranslate"><code class="notranslate">pip install pandas&lt;0.21
</code></pre></div>
</li>
<li>
<p dir="auto">Workaround for package maintainers to specify the pandas version in <code class="notranslate">install_requires</code>: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="314359671" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/20697" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/20697/hovercard?comment_id=381372004&amp;comment_type=issue_comment" href="https://github.com/pandas-dev/pandas/issues/20697#issuecomment-381372004">#20697 (comment)</a></p>
</li>
</ul>
</li>
<li>The fact that those version are downloaded for Python 3.4 (instead of an older compatible version) was a bug in our setup.py, and this will be fixed in future versions of pandas: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="314372081" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/20698" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/20698/hovercard" href="https://github.com/pandas-dev/pandas/pull/20698">#20698</a></li>
</ul>
<p dir="auto"><strong>Problem with installing pandas on "special" platforms (32bit, PyPy, ARM, ...) (building from source)</strong>:</p>
<ul dir="auto">
<li>You get the error <em>"No matching distribution found for Cython"</em></li>
<li>The reason for this error is that we do not provide wheels for such python versions or platforms. In such a case, <code class="notranslate">pip</code> will try to build pandas from source, but this started to fail with pip version 10. This is because their limited support for PEP518, and they require that all build dependencies of pandas are installed from wheels (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="314376984" data-permission-text="Title is private" data-url="https://github.com/pypa/pip/issues/5229" data-hovercard-type="issue" data-hovercard-url="/pypa/pip/issues/5229/hovercard" href="https://github.com/pypa/pip/issues/5229">pypa/pip#5229</a>), which are often also not available on those python versions / platforms.</li>
<li><strong>Solution</strong>
<ul dir="auto">
<li>Use an older version of pip</li>
<li>Use <code class="notranslate">pip install pandas --no-build-isolation</code></li>
</ul>
</li>
<li>See eg <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="313701198" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/20666" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/20666/hovercard" href="https://github.com/pandas-dev/pandas/issues/20666">#20666</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="316399092" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/20771" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/20771/hovercard" href="https://github.com/pandas-dev/pandas/issues/20771">#20771</a></li>
</ul>