Skip to content

DOC/TST: core/generic/drop doc-string and tests #5253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def drop(self, labels, axis=0, level=None):

Parameters
----------
labels : list-like
labels : list-like; passing a string or tuple will be treated as a single index label
axis : int
level : int or name, default None
For MultiIndex
Expand Down
5 changes: 5 additions & 0 deletions pandas/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,11 @@ def test_drop(self):
result = s.drop('one')
assert_series_equal(result,expected)

# single string/tuple-like
s = Series(range(3),index=list('abc'))
self.assertRaises(ValueError, s.drop, 'bc')
self.assertRaises(ValueError, s.drop, ('a',))

def test_ix_setitem(self):
inds = self.series.index[[3, 4, 7]]

Expand Down