-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
QST: Indexing over empty DataFrame #41415
Labels
Comments
YarShev
added
Needs Triage
Issue that has not been reviewed by a pandas team member
Usage Question
labels
May 11, 2021
attack68
removed
the
Needs Triage
Issue that has not been reviewed by a pandas team member
label
May 11, 2021
It's similar for python lists / numpy arrays as well >>> b = []
>>> b[3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>> b[3:5]
[]
>>> a = np.array([])
>>> a[3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: index 3 is out of bounds for axis 0 with size 0
>>> a[3:5]
array([], dtype=float64) |
@attack68 , @asishm-wk , thanks! That makes sense. |
Closing since the expected behavior has been explained. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have searched the [pandas] tag on StackOverflow for similar questions.
I have asked my usage related question on StackOverflow.
Question about pandas
Is it correct behavior when indexing over empty DataFrame?
The text was updated successfully, but these errors were encountered: