Skip to content

Commit

Permalink
TST: add test for series list indexing with missing values (pandas-de…
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored Jul 12, 2019
1 parent c633579 commit 0437f68
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,3 +1069,15 @@ def test_series_indexing_zerodim_np_array(self):
s = Series([1, 2])
result = s.loc[np.array(0)]
assert result == 1


def test_series_loc_getitem_label_list_missing_values():
# gh-11428
key = np.array(
["2001-01-04", "2001-01-02", "2001-01-04", "2001-01-14"], dtype="datetime64"
)
s = Series([2, 5, 8, 11], date_range("2001-01-01", freq="D", periods=4))
expected = Series([11.0, 5.0, 11.0, np.nan], index=key)
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
result = s.loc[key]
tm.assert_series_equal(result, expected)

0 comments on commit 0437f68

Please sign in to comment.