We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86a7dd4 commit b0060c5Copy full SHA for b0060c5
pandas/indexes/multi.py
@@ -2339,13 +2339,18 @@ def _check_equal_length(seq_of_seqs):
2339
A TypeError will be raised if inner sequence does not support len().
2340
2341
Return True if all sequences are the same length, otherwise False
2342
+ If seq_of_seqs is empty return True as well.
2343
"""
2344
seq_it = iter(seq_of_seqs)
- L0 = len(next(seq_it))
2345
- for seq in seq_it:
2346
- if len(seq) != L0:
2347
- return False
2348
- return True
+ try:
+ L0 = len(next(seq_it))
+ except StopIteration:
+ return True
2349
+ else:
2350
+ for seq in seq_it:
2351
+ if len(seq) != L0:
2352
+ return False
2353
2354
2355
2356
def _get_na_rep(dtype):
0 commit comments