<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 as pd
import numpy as np

bins = np.arange(0, 100, 10)
bins.flags.writeable = False
pd.cut(np.arange(100), bins)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-s1">bins</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">0</span>, <span class="pl-c1">100</span>, <span class="pl-c1">10</span>)
<span class="pl-s1">bins</span>.<span class="pl-s1">flags</span>.<span class="pl-s1">writeable</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>
<span class="pl-s1">pd</span>.<span class="pl-en">cut</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">100</span>), <span class="pl-s1">bins</span>)</pre></div>
<p dir="auto">Results in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ValueError                                Traceback (most recent call last)
&lt;ipython-input-71-60b85be1194d&gt; in &lt;module&gt;()
----&gt; 1 pd.cut(np.arange(100), bins)

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/core/reshape/tile.py in cut(x, bins, right, labels, retbins, precision, include_lowest)
    134                               precision=precision,
    135                               include_lowest=include_lowest,
--&gt; 136                               dtype=dtype)
    137
    138     return _postprocess_for_cut(fac, bins, retbins, x_is_series,

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/core/reshape/tile.py in _bins_to_cuts(x, bins, right, labels, precision, include_lowest, dtype, duplicates)
    225         return result, bins
    226
--&gt; 227     unique_bins = algos.unique(bins)
    228     if len(unique_bins) &lt; len(bins) and len(bins) != 2:
    229         if duplicates == 'raise':

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/core/algorithms.py in unique(values)
    354
    355     table = htable(len(values))
--&gt; 356     uniques = table.unique(values)
    357     uniques = _reconstruct_data(uniques, dtype, original)
    358

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.unique (pandas/_libs/hashtable.c:16341)()

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/_libs/hashtable.cpython-36m-darwin.so in View.MemoryView.memoryview_cwrapper (pandas/_libs/hashtable.c:45205)()

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/_libs/hashtable.cpython-36m-darwin.so in View.MemoryView.memoryview.__cinit__ (pandas/_libs/hashtable.c:41440)()

ValueError: buffer source array is read-only"><pre class="notranslate"><code class="notranslate">ValueError                                Traceback (most recent call last)
&lt;ipython-input-71-60b85be1194d&gt; in &lt;module&gt;()
----&gt; 1 pd.cut(np.arange(100), bins)

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/core/reshape/tile.py in cut(x, bins, right, labels, retbins, precision, include_lowest)
    134                               precision=precision,
    135                               include_lowest=include_lowest,
--&gt; 136                               dtype=dtype)
    137
    138     return _postprocess_for_cut(fac, bins, retbins, x_is_series,

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/core/reshape/tile.py in _bins_to_cuts(x, bins, right, labels, precision, include_lowest, dtype, duplicates)
    225         return result, bins
    226
--&gt; 227     unique_bins = algos.unique(bins)
    228     if len(unique_bins) &lt; len(bins) and len(bins) != 2:
    229         if duplicates == 'raise':

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/core/algorithms.py in unique(values)
    354
    355     table = htable(len(values))
--&gt; 356     uniques = table.unique(values)
    357     uniques = _reconstruct_data(uniques, dtype, original)
    358

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.unique (pandas/_libs/hashtable.c:16341)()

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/_libs/hashtable.cpython-36m-darwin.so in View.MemoryView.memoryview_cwrapper (pandas/_libs/hashtable.c:45205)()

~/conda/envs/xarray-py36/lib/python3.6/site-packages/pandas/_libs/hashtable.cpython-36m-darwin.so in View.MemoryView.memoryview.__cinit__ (pandas/_libs/hashtable.c:41440)()

ValueError: buffer source array is read-only
</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">This is essentially the same problem as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="72474981" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/10043" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/10043/hovercard" href="https://github.com/pandas-dev/pandas/issues/10043">#10043</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="248426153" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/17192" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/17192/hovercard" href="https://github.com/pandas-dev/pandas/issues/17192">#17192</a>, due to Cython issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="207556472" data-permission-text="Title is private" data-url="https://github.com/cython/cython/issues/1605" data-hovercard-type="issue" data-hovercard-url="/cython/cython/issues/1605/hovercard" href="https://github.com/cython/cython/issues/1605">cython/cython#1605</a></p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">Should not error.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<p dir="auto">In [73]: pd.show_versions()</p>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.3.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 16.7.0<br>
machine: x86_64<br>
processor: i386<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.20.3<br>
pytest: 3.2.1<br>
pip: 9.0.1<br>
setuptools: 36.4.0<br>
Cython: 0.26<br>
numpy: 1.13.1<br>
scipy: 0.19.1<br>
xarray: 0.10.0<br>
IPython: 6.1.0<br>
sphinx: 1.6.3<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">Dear all,</p>
<p dir="auto">Here from the mailing list: <a href="https://groups.google.com/forum/#!topic/pydata/jKiPOvYUQ1c" rel="nofollow">https://groups.google.com/forum/#!topic/pydata/jKiPOvYUQ1c</a></p>
<p dir="auto">I have an excel table about family ages like this</p>
<table role="table">
<thead>
<tr>
<th>Family</th>
<th>People</th>
<th>Mean size [cm]</th>
</tr>
</thead>
<tbody>
<tr>
<td>Foo</td>
<td>5</td>
<td>173.0</td>
</tr>
<tr>
<td>Bar</td>
<td>3</td>
<td>189.0</td>
</tr>
</tbody>
</table>
<p dir="auto">and I would like to use read_excel to parse it into Python. I would like "People" to be read as an integer, "Mean size [cm]" as a float. (And "Family" as a string, but that might be a different issue.) Now:</p>
<ul dir="auto">
<li>if I set convert_float=True, the last column reads as int</li>
<li>if I set convert_float=False, the second column reads as float</li>
</ul>
<p dir="auto">Neither one is correct, for a stupid reason: there happen to be those .0 in all sizes! So I would like to specify something like:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="convert_float = ['People']"><pre class="notranslate"><span class="pl-s1">convert_float</span> <span class="pl-c1">=</span> [<span class="pl-s">'People'</span>]</pre></div>
<p dir="auto">so only that column gets converted. An even better solution would be to be explicit about types of some columns, letting pandas perform the automagic for the others, such as:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="read_excel('foo.xlsx', types={'People': np.uint8, 'Family': 'S3'})"><pre class="notranslate"><span class="pl-en">read_excel</span>(<span class="pl-s">'foo.xlsx'</span>, <span class="pl-s1">types</span><span class="pl-c1">=</span>{<span class="pl-s">'People'</span>: <span class="pl-s1">np</span>.<span class="pl-s1">uint8</span>, <span class="pl-s">'Family'</span>: <span class="pl-s">'S3'</span>})</pre></div>
<p dir="auto">but this changes the signature of the function more significantly.</p>
<p dir="auto">Are you folks in favour of any of this? If yes, I can get a look and try to code it in.</p>