<h4 dir="auto">Code Sample</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; 
&gt;&gt;&gt; # Toy data
&gt;&gt;&gt; series = pd.Series([0, 1, 5, 6, 10, None, np.nan])
&gt;&gt;&gt; bins = [0, 5, 8]
&gt;&gt;&gt; 
&gt;&gt;&gt; pd.cut(series, bins=bins, include_lowest=True)

Out[23]:
0    (-0.001, 5.0]
1    (-0.001, 5.0]
2    (-0.001, 5.0]
3       (5.0, 8.0]
4              NaN
5              NaN
6              NaN
dtype: category
Categories (2, interval[float64]): [(-0.001, 5.0] &lt; (5.0, 8.0]]"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; 
&gt;&gt;&gt; # Toy data
&gt;&gt;&gt; series = pd.Series([0, 1, 5, 6, 10, None, np.nan])
&gt;&gt;&gt; bins = [0, 5, 8]
&gt;&gt;&gt; 
&gt;&gt;&gt; pd.cut(series, bins=bins, include_lowest=True)

Out[23]:
0    (-0.001, 5.0]
1    (-0.001, 5.0]
2    (-0.001, 5.0]
3       (5.0, 8.0]
4              NaN
5              NaN
6              NaN
dtype: category
Categories (2, interval[float64]): [(-0.001, 5.0] &lt; (5.0, 8.0]]
</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">It was expected that the lower boundary would be [0, 5] (for the first three instances). However, a value of -0.001 was "invented" (?). It worked in version 0.19.2 (with the output shown in Expected Output). Is there any bug? Is there anything I have to specify to make it work again as before?</p>
<h4 dir="auto">Expected Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0    [0, 5.0]
1    [0, 5.0]
2    [0, 5.0]
3    (5.0, 8.0]
4              NaN
5              NaN
6              NaN
dtype: category
Categories (2, interval[float64]): [ [0, 5.0] &lt; (5.0, 8.0]]"><pre class="notranslate"><code class="notranslate">0    [0, 5.0]
1    [0, 5.0]
2    [0, 5.0]
3    (5.0, 8.0]
4              NaN
5              NaN
6              NaN
dtype: category
Categories (2, interval[float64]): [ [0, 5.0] &lt; (5.0, 8.0]]
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-79-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
<p dir="auto">pandas: 0.20.3<br>
pytest: None<br>
pip: 9.0.1<br>
setuptools: 36.2.0<br>
Cython: None<br>
numpy: 1.13.1<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 2.0.0<br>
openpyxl: 2.4.1<br>
xlrd: 1.0.0<br>
xlwt: 1.2.0<br>
xlsxwriter: 0.9.8<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999999999<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">Hi,</p>
<p dir="auto">When trying to concat() multiple big fortran order arrays, there is a big performance hit, as most of the work goes into calling ravel().</p>
<p dir="auto">See:<br>
<a href="https://github.com/pydata/pandas/blob/master/pandas/core/internals.py#L4772">https://github.com/pydata/pandas/blob/master/pandas/core/internals.py#L4772</a></p>
<p dir="auto">You can see the  <code class="notranslate">is_null(self)</code> is using just a few values from the data after calling <code class="notranslate">.ravel()</code></p>
<p dir="auto">An easy fix is to change that line to <code class="notranslate">values_flat = values.ravel(order='K')</code></p>
<p dir="auto">Here is a link to numpy.ravel docs:  <a href="http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.ravel.html" rel="nofollow">http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.ravel.html</a></p>
<p dir="auto"><code class="notranslate">‘K’ means to read the elements in the order they occur in memory, except for reversing the data when strides are negative. By default, ‘C’ index order is used.</code></p>