-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use numpy.array's "offset" param instead of slicing
Passing an offset into numpy.array instead of slicing should prevent an additional copy of the data being created by the slice operation. This is important for really big message types like OccupancyGrids.
- Loading branch information
Alex Bencz
committed
Nov 26, 2014
1 parent
fd75f60
commit 52e2b1e
Showing
4 changed files
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
start = end | ||
end += 20 | ||
data = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=10) | ||
data = numpy.frombuffer(str, dtype=numpy.int16, count=10, offset=start) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters