[Numpy-discussion] Re: array.T.max() vs array.max(axis=0) performance difference

2025-03-22 Thread Fang Zhang
Sebastian, I think the core issue you pointed out is indeed correct, but your detailed explanation is backwards, since `maximum(arr[:, 0], arr[:, 1])` implements `arr.max(axis=1)` instead of `arr.max(axis=0)`. So OP's transpose method is essentially approach 1, which for this array shape has less

[Numpy-discussion] Re: np.where and ZeroDivisionError: float division by zero

2024-04-25 Thread Fang Zhang
The function np.where just chooses elements from two arrays that are both computed before np.where is even executed. See this StackOverflow answer https://stackoverflow.com/a/29950752/4681187 if you want to suppress the error. On Thu, Apr 25, 2024 at 8:16 PM 840362492--- via NumPy-Discussion < num

[Numpy-discussion] Feature request: Alternative representation for arrays with many dimensions

2020-12-09 Thread Fang Zhang
man eyes rather than computers, I think this should not cause too much of a compatibility problem. What do you all think? Sincerely, Fang Zhang ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion