Skip to content

Commit 350e724

Browse files
author
Ben Kandel
committed
simplified logic
1 parent 9615a69 commit 350e724

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/tools/merge.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1361,18 +1361,18 @@ def __init__(self, objs, axis=0, join='outer', join_axes=None,
13611361
objs = [obj for obj in objs if obj is not None]
13621362
else:
13631363
# #1649
1364-
clean_keys_list = []
1364+
clean_keys = []
13651365
clean_objs = []
13661366
for k, v in zip(keys, objs):
13671367
if v is None:
13681368
continue
1369-
clean_keys_list.append(k)
1369+
clean_keys.append(k)
13701370
clean_objs.append(v)
13711371
objs = clean_objs
1372-
clean_keys_index = Index(clean_keys_list)
13731372
if isinstance(keys, Index):
1374-
clean_keys_index.name = keys.name
1375-
keys = clean_keys_index
1373+
keys = Index(clean_keys, name=keys.name)
1374+
else:
1375+
keys = clean_keys
13761376

13771377
if len(objs) == 0:
13781378
raise ValueError('All objects passed were None')

0 commit comments

Comments
 (0)