diff --git a/pandas/io/tests/test_parsers.py b/pandas/io/tests/test_parsers.py index 6ecfca10c12c3..6e380bdd64099 100644 --- a/pandas/io/tests/test_parsers.py +++ b/pandas/io/tests/test_parsers.py @@ -1868,6 +1868,17 @@ def test_usecols_implicit_index_col(self): tm.assert_frame_equal(result, expected) + def test_usecols_with_whitespace(self): + # #2733 + data = 'a b c\n4 apple bat 5.7\n8 orange cow 10' + + result = self.read_csv(StringIO(data), delim_whitespace=True, + usecols=('a', 'b')) + expected = DataFrame({'a': ['apple', 'orange'], + 'b': ['bat', 'cow']}, index=[4, 8]) + + tm.assert_frame_equal(result, expected) + def test_pure_python_failover(self): data = "a,b,c\n1,2,3#ignore this!\n4,5,6#ignorethistoo"