[
https://issues.apache.org/jira/browse/ARROW-9430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17346930#comment-17346930
]
Joris Van den Bossche edited comment on ARROW-9430 at 5/18/21, 2:31 PM:
------------------------------------------------------------------------
And to summarize the behaviour of the last example of [~lidavidm]:
* This kernel sets values with a _boolean_ mask
* Nulls in the mask propagate as nulls in the result
* The length of the replacement values equals the number of {{true}} values in
the mask (the case where those replacement values are of equal length as the
input array / the mask is covered by "if_else" kernel)
This provides the equivalent behaviour of numpy's {{array[mask] = values}}
(except not modifying {{array}} in place, but returning a new array)
was (Author: jorisvandenbossche):
And to summarize the behaviour last example of [~lidavidm]:
* This kernel sets values with a _boolean_ mask
* Nulls in the mask propagate as nulls in the result
* The length of the replacement values equals the number of {{true}} values in
the mask (the case where those replacement values are of equal length as the
input array / the mask is covered by "if_else" kernel)
This provides the equivalent behaviour of numpy's {{array[mask] = values}}
(except not modifying {{array}} in place, but returning a new array)
> [C++/Python] Kernel for SetItem(BooleanArray, values)
> -----------------------------------------------------
>
> Key: ARROW-9430
> URL: https://issues.apache.org/jira/browse/ARROW-9430
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++, Python
> Reporter: Uwe Korn
> Priority: Major
>
> We should have a kernel that allows overriding the values of an array by
> supplying a boolean mask and a scalar or an array of equal length.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)