Assigns a scalar value specified by 'src_dtype' and 'src_data' to elements of 'dst'.
dst: The destination array. src_dtype: The data type of the source scalar. src_data: The memory element of the source scalar. wheremask: If non-NULL, a boolean mask specifying where to copy. casting: An exception is raised if the assignment violates this
System Message: ERROR/3 (<string>
, line 9) Unexpected indentation.
<blockquote> casting rule.</blockquote>
This function is implemented in array_assign_scalar.c.
Returns 0 on success, -1 on failure.
Check the casting rule
Make a copy of the src data if it's a different dtype than 'dst' or isn't aligned, and the destination we're copying to has more than one element. To avoid having to manage object lifetimes, we also skip this if 'dst' has an object dtype.
Use a static buffer to store the aligned/cast version, or allocate some memory if more space is needed.
Replace src_data/src_dtype
A straightforward value assignment
Do the assignment with raw array iteration
Broadcast the wheremask to 'dst' for raw iteration
Do the masked assignment with raw array iteration