-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
QST: Indexing over empty DataFrame #41415
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
Labels
Comments
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: