Python Pandas read_excel doesn't recognize null cell
<p>My excel sheet:</p>

<pre><code>   A   B  
1 first second
2
3 
4  x   y  
5  z   j
</code></pre>

<p>Python code:</p>

<pre><code>df = pd.read_excel (filename, parse_cols=1)
</code></pre>

<p>return a correct output:</p>

<pre><code>  first second
0 NaN   NaN
1 NaN   NaN
2 x     y
3 z     j
</code></pre>

<p>If i want work only with second column</p>

<pre><code>df = pd.read_excel (filename, parse_cols=[1])
</code></pre>

<p>return:</p>

<pre><code> second
0  y
1  j
</code></pre>

<p>I'd have information about empty excel rows (NaN in my df) even if I work only with a specific column.
If output loose NaN information  it's not ok, for example, for skiprows paramater, etc</p>

<p>Thanks</p>

<p>For me works parameter <code>skip_blank_lines=False</code>:</p>

<pre><code>df = pd.read_excel ('test.xlsx', 
                     parse_cols=1, 
                     skip_blank_lines=False)
print (df)

       A       B
0  first  second
1    NaN     NaN
2    NaN     NaN
3      x       y
4      z       j
</code></pre>

<p>Or if need omit first row:</p>

<pre><code>df = pd.read_excel ('test.xlsx', 
                     parse_cols=1, 
                     skiprows=1,
                     skip_blank_lines=False)
print (df)

  first second
0   NaN    NaN
1   NaN    NaN
2     x      y
3     z      j
</code></pre>

python excel pandas