Skip to content

ENH: indexing and __getitem__ of dataframe and series accept zerodim integer np.array as int #24924

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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test compares the result and expected value
  • Loading branch information
tamuhey committed Jan 27, 2019
commit 16bbaa9b5893a1070c5f7e1da33d545316e16054
6 changes: 5 additions & 1 deletion pandas/tests/indexing/test_iloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,8 @@ def test_indexing_zero_dim_np_array(self):
df = DataFrame([[1, 2], [3, 4]])

# should not raise an error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these comments are not needed (and same below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

df.iloc[np.array(0)]
result = df.iloc[np.array(0)]

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