Skip to content

Commit

Permalink
CLN: remove redundant comment, and name series as s
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuhey committed Jan 29, 2019
1 parent b8acbde commit 8d4c9a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
19 changes: 6 additions & 13 deletions pandas/tests/indexing/test_iloc.py
Expand Up @@ -676,22 +676,15 @@ def test_identity_slice_returns_new_object(self):
original_series[:3] = [7, 8, 9]
assert all(sliced_series[:3] == [7, 8, 9])

def test_indexing_zero_dim_np_array(self):
def test_indexing_zerodim_np_array(self):
# GH24919
df = DataFrame([[1, 2], [3, 4]])

# should not raise an error
result = df.iloc[np.array(0)]
s = pd.Series([1, 2], name=0)
tm.assert_series_equal(result, s)

# expected series
sr = pd.Series([1, 2], name=0)
tm.assert_series_equal(result, sr)

def test_series_indexing_zero_dim_np_array(self):
def test_series_indexing_zerodim_np_array(self):
# GH24919
sr = Series([1, 2])

# should not raise an error
result = sr.iloc[np.array(0)]

s = Series([1, 2])
result = s.iloc[np.array(0)]
assert result == 1
19 changes: 6 additions & 13 deletions pandas/tests/indexing/test_loc.py
Expand Up @@ -766,22 +766,15 @@ def test_loc_setitem_empty_append_raises(self):
with pytest.raises(ValueError, match=msg):
df.loc[0:2, 'x'] = data

def test_indexing_zero_dim_np_array(self):
def test_indexing_zerodim_np_array(self):
# GH24924
df = DataFrame([[1, 2], [3, 4]])

# should not raise an error
result = df.loc[np.array(0)]
s = pd.Series([1, 2], name=0)
tm.assert_series_equal(result, s)

# expected series
sr = pd.Series([1, 2], name=0)
tm.assert_series_equal(result, sr)

def test_series_indexing_zero_dim_np_array(self):
def test_series_indexing_zerodim_np_array(self):
# GH24924
sr = Series([1, 2])

# should not raise an error
result = sr.loc[np.array(0)]

s = Series([1, 2])
result = s.loc[np.array(0)]
assert result == 1

0 comments on commit 8d4c9a1

Please sign in to comment.