<p dir="auto">When using <code class="notranslate">pd.DataFrame.describe</code>, if your percentiles are different only at the 4th decimal place, a <code class="notranslate">ValueError</code> is thrown because the the percentiles that vary at the 4th decimal place become the same value.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: s = Series(np.random.randn(10))

In [2]: s.describe()
Out[2]: 
count    10.000000
mean      0.291571
std       1.057143
min      -1.453547
25%      -0.614614
50%       0.637435
75%       0.968905
max       1.823964
dtype: float64

In [3]: s.describe(percentiles=[0.0001, 0.0005, 0.001, 0.999, 0.9995, 0.9999])
Out[3]: 
count     10.000000
mean       0.291571
std        1.057143
min       -1.453547
0.0%      -1.453107
0.1%      -1.451348
0.1%      -1.449149
50%        0.637435
99.9%      1.817201
100.0%     1.820583
100.0%     1.823288
max        1.823964
dtype: float64"><pre class="notranslate"><code class="notranslate">In [1]: s = Series(np.random.randn(10))

In [2]: s.describe()
Out[2]: 
count    10.000000
mean      0.291571
std       1.057143
min      -1.453547
25%      -0.614614
50%       0.637435
75%       0.968905
max       1.823964
dtype: float64

In [3]: s.describe(percentiles=[0.0001, 0.0005, 0.001, 0.999, 0.9995, 0.9999])
Out[3]: 
count     10.000000
mean       0.291571
std        1.057143
min       -1.453547
0.0%      -1.453107
0.1%      -1.451348
0.1%      -1.449149
50%        0.637435
99.9%      1.817201
100.0%     1.820583
100.0%     1.823288
max        1.823964
dtype: float64
</code></pre></div>
<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="import pandas

a = pandas.DataFrame({'a': ['0'], 'b': ['str']})

print('---')
print(a)

a.iloc[:, 0] = [int(v) for v in a.iloc[:, 0]]

print('---')
print(a)

b = pandas.concat([a, pandas.DataFrame({'b': ['str2']})], axis=1)

print('---')
print(b)

b.iloc[:, 2] = ['str3']

print('---')
print(b)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span>

<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'a'</span>: [<span class="pl-s">'0'</span>], <span class="pl-s">'b'</span>: [<span class="pl-s">'str'</span>]})

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">a</span>)

<span class="pl-s1">a</span>.<span class="pl-s1">iloc</span>[:, <span class="pl-c1">0</span>] <span class="pl-c1">=</span> [<span class="pl-en">int</span>(<span class="pl-s1">v</span>) <span class="pl-k">for</span> <span class="pl-s1">v</span> <span class="pl-c1">in</span> <span class="pl-s1">a</span>.<span class="pl-s1">iloc</span>[:, <span class="pl-c1">0</span>]]

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">a</span>)

<span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-en">concat</span>([<span class="pl-s1">a</span>, <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'b'</span>: [<span class="pl-s">'str2'</span>]})], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">b</span>)

<span class="pl-s1">b</span>.<span class="pl-s1">iloc</span>[:, <span class="pl-c1">2</span>] <span class="pl-c1">=</span> [<span class="pl-s">'str3'</span>]

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">b</span>)</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">The issue seems to be that if there is a DataFrame with duplicate column names and mixed dtypes, if I try to replace one column with another value, using <code class="notranslate">iloc</code>, another column with same name is replaced as well.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">The final print should be:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   a    b     b
0  0  str  str3"><pre class="notranslate"><code class="notranslate">   a    b     b
0  0  str  str3
</code></pre></div>
<p dir="auto">And not:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   a     b     b
0  0  str3  str3"><pre class="notranslate"><code class="notranslate">   a     b     b
0  0  str3  str3
</code></pre></div>
<p dir="auto">It is interesting that if I change concat line to (see renaming of column <code class="notranslate">b</code> to <code class="notranslate">c</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="b = pandas.concat([a, pandas.DataFrame({'c': ['str2']})], axis=1)"><pre class="notranslate"><code class="notranslate">b = pandas.concat([a, pandas.DataFrame({'c': ['str2']})], axis=1)
</code></pre></div>
<p dir="auto">Then the output is correctly:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   a    b     c
0  0  str  str3"><pre class="notranslate"><code class="notranslate">   a    b     c
0  0  str  str3
</code></pre></div>
<p dir="auto">Also, if <code class="notranslate">a.iloc[:, 0] = [int(v) for v in a.iloc[:, 0]]</code> is commented out, it works also correctly.</p>
<p dir="auto">Moreover, the following also work correctly (see the change of <code class="notranslate">0</code> column index into <code class="notranslate">[0]</code> column index, and similar for <code class="notranslate">2</code> (this latter change is not really necessary to make it work)):</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas

a = pandas.DataFrame({'a': ['0'], 'b': ['str']})

print('---')
print(a)

a.iloc[:, [0]] = [int(v) for v in a.iloc[:, 0]]

print('---')
print(a)

b = pandas.concat([a, pandas.DataFrame({'b': ['str2']})], axis=1)

print('---')
print(b)

b.iloc[:, [2]] = ['str3']

print('---')
print(b)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span>

<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'a'</span>: [<span class="pl-s">'0'</span>], <span class="pl-s">'b'</span>: [<span class="pl-s">'str'</span>]})

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">a</span>)

<span class="pl-s1">a</span>.<span class="pl-s1">iloc</span>[:, [<span class="pl-c1">0</span>]] <span class="pl-c1">=</span> [<span class="pl-en">int</span>(<span class="pl-s1">v</span>) <span class="pl-k">for</span> <span class="pl-s1">v</span> <span class="pl-c1">in</span> <span class="pl-s1">a</span>.<span class="pl-s1">iloc</span>[:, <span class="pl-c1">0</span>]]

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">a</span>)

<span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-en">concat</span>([<span class="pl-s1">a</span>, <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'b'</span>: [<span class="pl-s">'str2'</span>]})], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">b</span>)

<span class="pl-s1">b</span>.<span class="pl-s1">iloc</span>[:, [<span class="pl-c1">2</span>]] <span class="pl-c1">=</span> [<span class="pl-s">'str3'</span>]

<span class="pl-en">print</span>(<span class="pl-s">'---'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">b</span>)</pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.3.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.13.0-46-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: en_US.UTF-8</p>
<p dir="auto">pandas: 0.23.3<br>
pytest: None<br>
pip: 18.0<br>
setuptools: 40.0.0<br>
Cython: None<br>
numpy: 1.15.0<br>
scipy: None<br>
pyarrow: None<br>
xarray: None<br>
IPython: None<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.7.3<br>
pytz: 2018.5<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: None<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: None<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>