<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 [97]:  s1 = pd.Series([1,2,3], index=[4,5,6])

In [98]:  s2 = pd.Series([1,3,2], index=s1)

In [99]: s2
Out[101]: 
1    1
2    3
3    2
dtype: int64"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">97</span>]:  <span class="pl-s1">s1</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">4</span>,<span class="pl-c1">5</span>,<span class="pl-c1">6</span>])

<span class="pl-v">In</span> [<span class="pl-c1">98</span>]:  <span class="pl-s1">s2</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">1</span>,<span class="pl-c1">3</span>,<span class="pl-c1">2</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">s1</span>)

<span class="pl-v">In</span> [<span class="pl-c1">99</span>]: <span class="pl-s1">s2</span>
<span class="pl-v">Out</span>[<span class="pl-c1">101</span>]: 
<span class="pl-c1">1</span>    <span class="pl-c1">1</span>
<span class="pl-c1">2</span>    <span class="pl-c1">3</span>
<span class="pl-c1">3</span>    <span class="pl-c1">2</span>
<span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div>
<p dir="auto">so far so good, now lets try a boolean series</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [101]: s3 = pd.Series([1,3,2], index=(s1==2))

In [102]: s3
...
...
~/anaconda3/lib/python3.5/site-packages/pandas/core/indexes/base.py in _format_with_header(self, header, na_rep, **kwargs)
   1905             values = np.array(values)
   1906         elif is_object_dtype(values.dtype):
-&gt; 1907             values = lib.maybe_convert_objects(values, safe=1)
   1908 
   1909         if is_object_dtype(values.dtype):

TypeError: Argument 'objects' has incorrect type (expected numpy.ndarray, got Series)

In [103]: s3.index
...
...
~/anaconda3/lib/python3.5/site-packages/pandas/core/indexes/base.py in inferred_type(self)
   1567     def inferred_type(self):
   1568         &quot;&quot;&quot; return a string of the type inferred from the values &quot;&quot;&quot;
-&gt; 1569         return lib.infer_dtype(self)
   1570 
   1571     def _is_memory_usage_qualified(self):

pandas/_libs/src/inference.pyx in pandas._libs.lib.infer_dtype (pandas/_libs/lib.c:47002)()

ValueError: cannot infer type for &lt;class 'NoneType'&gt;"><pre class="notranslate"><code class="notranslate">In [101]: s3 = pd.Series([1,3,2], index=(s1==2))

In [102]: s3
...
...
~/anaconda3/lib/python3.5/site-packages/pandas/core/indexes/base.py in _format_with_header(self, header, na_rep, **kwargs)
   1905             values = np.array(values)
   1906         elif is_object_dtype(values.dtype):
-&gt; 1907             values = lib.maybe_convert_objects(values, safe=1)
   1908 
   1909         if is_object_dtype(values.dtype):

TypeError: Argument 'objects' has incorrect type (expected numpy.ndarray, got Series)

In [103]: s3.index
...
...
~/anaconda3/lib/python3.5/site-packages/pandas/core/indexes/base.py in inferred_type(self)
   1567     def inferred_type(self):
   1568         """ return a string of the type inferred from the values """
-&gt; 1569         return lib.infer_dtype(self)
   1570 
   1571     def _is_memory_usage_qualified(self):

pandas/_libs/src/inference.pyx in pandas._libs.lib.infer_dtype (pandas/_libs/lib.c:47002)()

ValueError: cannot infer type for &lt;class 'NoneType'&gt;
</code></pre></div>
<p dir="auto">now a dataframe</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [178]: df = pd.DataFrame([[1,2],[3,4],[5,6]], index=[3,6,9])

In [180]: s4 = pd.Series([1,3,2], index=df)

In [181]: s4
...
...
~/anaconda3/lib/python3.5/site-packages/pandas/io/formats/format.py in &lt;lambda&gt;(x)
   1967 
   1968     def _format_strings(self):
-&gt; 1969         formatter = self.formatter or (lambda x: '% d' % x)
   1970         fmt_values = [formatter(x) for x in self.values]
   1971         return fmt_values

TypeError: %d format: a number is required, not numpy.ndarray

In [182]: s4.index
Out[182]: Int64Index([[1, 2], [3, 4], [5, 6]], dtype='int64')
"><pre class="notranslate"><code class="notranslate">In [178]: df = pd.DataFrame([[1,2],[3,4],[5,6]], index=[3,6,9])

In [180]: s4 = pd.Series([1,3,2], index=df)

In [181]: s4
...
...
~/anaconda3/lib/python3.5/site-packages/pandas/io/formats/format.py in &lt;lambda&gt;(x)
   1967 
   1968     def _format_strings(self):
-&gt; 1969         formatter = self.formatter or (lambda x: '% d' % x)
   1970         fmt_values = [formatter(x) for x in self.values]
   1971         return fmt_values

TypeError: %d format: a number is required, not numpy.ndarray

In [182]: s4.index
Out[182]: Int64Index([[1, 2], [3, 4], [5, 6]], dtype='int64')

</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">I would expect passing a boolean Series as the index= parameter to either act as Series.index (as in the example where the integer Series s1 is used as an index) or Series.values (as the docs seem imply <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html" rel="nofollow">http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html</a> "<em>index : <strong>array-like</strong> or Index (1d)</em>")</p>
<p dir="auto">For the DataFrame case, it could either use df.index, or fail early with a ValueError</p>
<p dir="auto">[this should explain <strong>why</strong> the current behaviour is a problem and why the expected output is a better solution.]</p>
<p dir="auto"><strong>Note</strong>: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!</p>
<p dir="auto"><strong>Note</strong>: Many problems can be resolved by simply upgrading <code class="notranslate">pandas</code> to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if <code class="notranslate">master</code> addresses this issue, but that is not necessary.</p>
<p dir="auto">For documentation-related issues, you can check the latest versions of the docs on <code class="notranslate">master</code> here:</p>
<p dir="auto"><a href="https://pandas-docs.github.io/pandas-docs-travis/" rel="nofollow">https://pandas-docs.github.io/pandas-docs-travis/</a></p>
<p dir="auto">If the issue has not been resolved there, go ahead and file it in the issue tracker.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">either</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [101]: s3 = pd.Series([1,3,2], index=(s1==2))
In [102]: s3
Out[119]: 
4    1
5    3
6    2
dtype: int64

In [103]: s4 = pd.Series([1,2,3], index=df)
In [104]: s4
Out[104]: 
4    1
5    2
6    3
dtype: int64"><pre class="notranslate"><code class="notranslate">In [101]: s3 = pd.Series([1,3,2], index=(s1==2))
In [102]: s3
Out[119]: 
4    1
5    3
6    2
dtype: int64

In [103]: s4 = pd.Series([1,2,3], index=df)
In [104]: s4
Out[104]: 
4    1
5    2
6    3
dtype: int64
</code></pre></div>
<p dir="auto">OR</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [121]: s3
Out[121]: 
False    1
True     3
False    2
dtype: int64

s4 = pd.Series([1,3,2], index=df)
ValueError"><pre class="notranslate"><code class="notranslate">In [121]: s3
Out[121]: 
False    1
True     3
False    2
dtype: int64

s4 = pd.Series([1,3,2], index=df)
ValueError
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">[paste the output of <code class="notranslate">pd.show_versions()</code> here below this line]<br>
INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.4.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 17.2.0<br>
machine: x86_64<br>
processor: i386<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_GB.UTF-8<br>
LOCALE: en_GB.UTF-8</p>
<p dir="auto">pandas: 0.20.3<br>
pytest: 3.2.1<br>
pip: 9.0.1<br>
setuptools: 36.4.0<br>
Cython: 0.26<br>
numpy: 1.12.1<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 6.1.0<br>
sphinx: 1.6.3<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.2<br>
numexpr: 2.6.2<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: 2.4.8<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 0.9.8<br>
lxml: 3.8.0<br>
bs4: 4.6.0<br>
html5lib: 0.9999999<br>
sqlalchemy: 1.1.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; d = pandas.Series({('1ab','2'): 3, ('1ab',3):4}, )
&gt;&gt;&gt; d = pandas.concat([d,d])
&gt;&gt;&gt; d = pandas.concat([d,d], axis=1) 
&gt;&gt;&gt; pickle.loads(pickle.dumps(d))
       0  1
1ab 3  4  4
    2  3  3
    3  4  4
    2  3  3
&gt;&gt;&gt; pickle.loads(pickle.dumps(d.T))
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/usr/lib64/python2.7/pickle.py&quot;, line 1382, in loads
    return Unpickler(file).load()
  File &quot;/usr/lib64/python2.7/pickle.py&quot;, line 858, in load
    dispatch[key](self)
  File &quot;/usr/lib64/python2.7/pickle.py&quot;, line 1217, in load_build
    setstate(state)
  File &quot;venv/lib/python2.7/site-packages/pandas/core/internals.py&quot;, line 2063, in __setstate__
    placement=self.axes[0].get_indexer(items))
  File &quot;venv/lib/python2.7/site-packages/pandas/core/index.py&quot;, line 3200, in get_indexer
    raise Exception('Reindexing only valid with uniquely valued Index '
Exception: Reindexing only valid with uniquely valued Index objects"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; d = pandas.Series({('1ab','2'): 3, ('1ab',3):4}, )
&gt;&gt;&gt; d = pandas.concat([d,d])
&gt;&gt;&gt; d = pandas.concat([d,d], axis=1) 
&gt;&gt;&gt; pickle.loads(pickle.dumps(d))
       0  1
1ab 3  4  4
    2  3  3
    3  4  4
    2  3  3
&gt;&gt;&gt; pickle.loads(pickle.dumps(d.T))
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/lib64/python2.7/pickle.py", line 1382, in loads
    return Unpickler(file).load()
  File "/usr/lib64/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib64/python2.7/pickle.py", line 1217, in load_build
    setstate(state)
  File "venv/lib/python2.7/site-packages/pandas/core/internals.py", line 2063, in __setstate__
    placement=self.axes[0].get_indexer(items))
  File "venv/lib/python2.7/site-packages/pandas/core/index.py", line 3200, in get_indexer
    raise Exception('Reindexing only valid with uniquely valued Index '
Exception: Reindexing only valid with uniquely valued Index objects
</code></pre></div>