8000 FIX: pandas indexing error · matplotlib/matplotlib@2f73778 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f73778

Browse files
committed
FIX: pandas indexing error
pd.Series prefer indexing via searching the index to positional indexing. This method will get the first element of any iterable. It will advance a generater, but they did not work previously anyway. Closes #5550
1 parent 8228dbd commit 2f73778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ def default_units(x, axis):
15611561
x = x.ravel()
15621562

15631563
try:
1564-
x = x[0]
1564+
x = next(iter(x))
15651565
except (TypeError, IndexError):
15661566
pass
15671567

0 commit comments

Comments
 (0)
0