Skip to content

Commit d3c7200

Browse files
committed
added unit-test to highlight issue pandas-dev#54564
1 parent 1c5c4ef commit d3c7200

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pandas/tests/io/data/excel/test6.xls

5.5 KB
Binary file not shown.

pandas/tests/io/excel/test_xlrd.py

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22

3+
import numpy as np
34
import pytest
45

56
import pandas as pd
@@ -44,6 +45,17 @@ def test_read_xlsx_fails(datapath):
4445
pd.read_excel(path, engine="xlrd")
4546

4647

48+
def test_nan_in_xls(datapath):
49+
# GH 54564
50+
path = datapath("io", "data", "excel", "test6.xls")
51+
52+
expected = pd.DataFrame(np.r_[:3, np.nan].reshape(2, 2))
53+
54+
result = pd.read_excel(path)
55+
56+
tm.assert_frame_equal(result, expected)
57+
58+
4759
@pytest.mark.parametrize(
4860
"file_header",
4961
[

0 commit comments

Comments
 (0)