[Numpy-discussion] Re: Feature proposal: weighted gram matrix / sandwich product

2025-08-18 Thread Kevin Sheppard via NumPy-Discussion
This is a good place for numba if performance and memory use are a concern. Good NumPy 125 ms ± 2.42 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) Naive numba (memory efficient) 386 ms ± 1.83 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) Parallel numba (memory efficient, cpu bo

[Numpy-discussion] Re: Proposal to Extend NumPy Broadcasting for (D₁, D₂, ..., N, M) → (D₁, D₂, ..., K, M) When K is a Multiple of N (K % N == 0)

2025-03-25 Thread Kevin Sheppard via NumPy-Discussion
I think one aspect that would be hard to think about is how the tiling would happen when broadcasting from K -> N where N/K is an integer. There are at least 2 different ways to tile that would produce different results. Suppose you have the array [[1, 2, 3]] which is (1,3). If you wanted to bro

[Numpy-discussion] Expected behavior of np.array(..., copy=True)

2024-10-08 Thread Kevin Sheppard via NumPy-Discussion
Can anyone shed some light on the expected behavior of code using array(..., copy=True) with pandas objects? We ran into this in statsmodels and I think there are probably plenty of places where we explicitly call array(..., copy=True) and think we should have a totally independent copy of the data