We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62cbc27 commit 927d439Copy full SHA for 927d439
pandas/indexes/multi.py
@@ -2379,13 +2379,18 @@ def _check_equal_length(seq_of_seqs):
2379
A TypeError will be raised if inner sequence does not support len().
2380
2381
Return True if all sequences are the same length, otherwise False
2382
+ If seq_of_seqs is empty return True as well.
2383
"""
2384
seq_it = iter(seq_of_seqs)
- L0 = len(next(seq_it))
2385
- for seq in seq_it:
2386
- if len(seq) != L0:
2387
- return False
2388
- return True
+ try:
+ L0 = len(next(seq_it))
+ except StopIteration:
+ return True
2389
+ else:
2390
+ for seq in seq_it:
2391
+ if len(seq) != L0:
2392
+ return False
2393
2394
2395
2396
def _get_na_rep(dtype):
0 commit comments