8000 ENH: Avoid memory peak and useless computations when printing a MaskedArray. by saimn · Pull Request #6748 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Avoid memory peak and useless computations when printing a MaskedArray. #6748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 1, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use integer division to avoid casting to int.
  • Loading branch information
saimn committed Dec 1, 2015
commit d0e9d98b2aa126bb2654c4c5966a4034c4bb99fc
2 changes: 1 addition & 1 deletion numpy/ma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3718,7 +3718,7 @@ def __str__(self):
# object dtype, extract the corners before the conversion.
for axis in range(self.ndim):
if data.shape[axis] > self._print_width:
ind = np.int(self._print_width / 2)
ind = self._print_width // 2
arr = np.split(data, (ind, -ind), axis=axis)
data = np.concatenate((arr[0], arr[2]), axis=axis)
arr = np.split(mask, (ind, -ind), axis=axis)
Expand Down
0