The sample weight could have been 0-d, just a scalar. This was my way of making it an array. But it is true that the subsequent multiplications work with scalars as well as 1d arrays. The crucial point is that the array must not be higher dimensional, so yes, I will add this verification