Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 87e5e72

Browse files
authoredJan 12, 2022
Set inplace to True in sorting function in the example code (#104)
Because `inplace` in `sort` defaults to `False`
1 parent 6651da5 commit 87e5e72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎docs/example/deep_layout_parsing/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ Finally sort the text regions and assign ids:
118118
left_interval = lp.Interval(0, w/2*1.05, axis='x').put_on_canvas(image)
119119
120120
left_blocks = text_blocks.filter_by(left_interval, center=True)
121-
left_blocks.sort(key = lambda b:b.coordinates[1])
121+
left_blocks.sort(key = lambda b:b.coordinates[1], inplace=True)
122122
123123
right_blocks = [b for b in text_blocks if b not in left_blocks]
124-
right_blocks.sort(key = lambda b:b.coordinates[1])
124+
right_blocks.sort(key = lambda b:b.coordinates[1], inplace=True)
125125
126126
# And finally combine the two list and add the index
127127
# according to the order

0 commit comments

Comments
 (0)
Please sign in to comment.