Skip to content

Commit cd95131

Browse files
Clean up index name if not multiindex
Co-Authored-By: Marc Garcia <[email protected]>
1 parent 7ae07bd commit cd95131

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6243,7 +6243,7 @@ def explode(self, column: Union[str, Tuple]) -> "DataFrame":
62436243
for num, val in enumerate(self.index.names)
62446244
]
62456245
else:
6246-
index_names = [i if i else "index" for i in [self.index.name]]
6246+
index_names = [self.index.name or "index"]
62476247

62486248
column_with_index = self[column].reset_index()
62496249

0 commit comments

Comments
 (0)