title: Checking that a pandas.Series.index contains a value
body: <p>I (think I) know how to check if a value is contained in the index of a pandas Series, but I can't get it to work in the example below. Is it a bug perhaps?</p>
  
  <p>First, I generate some random numbers:</p>
  
  <pre class="lang-python prettyprint-override"><code>import numpy as np
  import pandas as pd
  
  some_numbers = np.random.randint(0,4,size=10)
  print(some_numbers)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[0 2 2 3 1 1 2 2 3 2]
  </code></pre>
  
  <p>Then, I create a Series with those numbers and compute their frequency</p>
  
  <pre class="lang-python prettyprint-override"><code>s = pd.Series(some_numbers)
  gb = s.groupby(s).size() / len(s)
  print(gb)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>0    0.1
  1    0.2
  2    0.5
  3    0.2
  dtype: float64
  </code></pre>
  
  <p>So far, so good. But I do not understand the output of the next line of code:</p>
  
  <pre class="lang-python prettyprint-override"><code>1.3 in gb
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>True
  </code></pre>
  
  <p>Shouldn't the output be False?
  (I have pandas 0.20.3 on Python 3.6.2)</p>
  
  <p>I know that I could use </p>
  
  <pre><code>1.3 in list(gb.index)
  </code></pre>
  
  <p>but this is not very efficient if the Series is large.</p>
  
  <h1>SIMPLER EXAMPLE TO SHOW THE BUG</h1>
  
  <pre class="lang-python prettyprint-override"><code>import pandas as pd
  s = pd.Series([.1,.2,.3])
  print(s)
  
  0    0.1
  1    0.2
  2    0.3
  dtype: float64
  </code></pre>
  
  <pre class="lang-python prettyprint-override"><code>3.4 in s
  
  False
  </code></pre>
  
  <p>but, wait for it...</p>
  
  <pre><code>s = pd.Series([.1,.2,.3,.4])
  print(s)
  
  0    0.1
  1    0.2
  2    0.3
  3    0.4
  dtype: float64
  </code></pre>
  
  <pre class="lang-python prettyprint-override"><code>3.4 in s
  
  True
  </code></pre>