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

2025-04-04 Thread Sebastian Berg
On Sun, 2025-03-23 at 10:17 +0800, Fang Zhang wrote: > 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 Ah, right, I explained things thinking of axis=1, thanks! As you sai

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

2025-04-04 Thread George Tsiamasiotis via NumPy-Discussion
Hello NumPy community! I was writing a function that calculates the bounding box of a polygon (the smallest rectangle that fully contains the polygon, and who's sides are parallel to the x and y axes). The input is a (N,2) array containing the vertices of the polygon, and the output is a 4-tuple c