Skip to content

Commit 4ea92e0

Browse files
Make sure the cells and columns are sorted before writing them out
1 parent 1bfa4c4 commit 4ea92e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/io/excel/_odswriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def write_cells(
6262
rows = defaultdict(TableRow)
6363
col_count = defaultdict(int)
6464

65-
for cell in cells:
65+
for cell in sorted(cells, key=lambda cell: (cell.row, cell.col)):
6666
# print(cell.row, cell.col, cell.val)
6767
# fill with empty cells if needed
6868
for _ in range(cell.col - col_count[cell.row]):

0 commit comments

Comments
 (0)