Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20924 from seberg/cleanup-scalar-fill
MAINT: Simplify element setting and use it for filling
- Loading branch information
Showing
9 changed files
with
154 additions
and
230 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
``array.fill(scalar)`` may behave slightly different | ||
---------------------------------------------------- | ||
`~numpy.ndarray.fill` may in some cases behave slightly different | ||
now due to the fact that the logic is aligned with item assignment:: | ||
|
||
arr = np.array([1]) # with any dtype/value | ||
arr.fill(scalar) | ||
# is now identical to: | ||
arr[0] = scalar | ||
|
||
Previously casting may have produced slightly different answers when using | ||
values that could not be represented in the target ``dtype`` or when the | ||
target had ``object`` dtype. |
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
Oops, something went wrong.