[Numpy-discussion] Assign shifted diagonal values with `np.fill_diagonal` and similar behaviour as `np.diag`

2020-12-14 Thread Ivan Gonzalez
As the subject says it will be great if `np.fill_diagonal` had a k-ith diagonal argument as `np.diag` does. The behavior expected (and a hack for the solution) is better explained in the following StackOverflow questions by me: https://stackoverflow.com/questions/65299295/assign-shifted-diagonal-va

[Numpy-discussion] Fwd: ndarray should offer __format__ that can adjust precision

2021-07-25 Thread Ivan Gonzalez
It would be nice to be able to use the Python syntax we already use to format the precision of floating numbers in numpy: >>> a = np.array([-np.pi, np.pi]) >>> print(f"{a:+.2f}") [-3.14 +3.14] This is particularly useful when you have large arrangements. The problem is that if you want to do it tod