On Wednesday, 11 March 2020 at 06:12:55 UTC, 9il wrote:
[snip]
Almost the same, just fixed import for `each` and a bit polished
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.18"
+/
import mir.ndslice;
import mir.ndslice.sorting;
import mir.algorithm.iteration: each;
void main() {
On Wednesday, 11 March 2020 at 06:12:55 UTC, 9il wrote:
On Wednesday, 11 March 2020 at 00:24:13 UTC, jmh530 wrote:
[...]
Almost the same, just fixed import for `each` and a bit polished
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.18"
+/
import mir.ndslice;
import
On Wednesday, 11 March 2020 at 00:24:13 UTC, jmh530 wrote:
On Tuesday, 10 March 2020 at 23:31:55 UTC, p.shkadzko wrote:
[snip]
Below does the same thing as the numpy version.
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.18"
+/
import mir.ndslice.sorting : sort;
import
On Tuesday, 10 March 2020 at 23:31:55 UTC, p.shkadzko wrote:
[snip]
Below does the same thing as the numpy version.
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.18"
+/
import mir.ndslice.sorting : sort;
import mir.ndslice.topology : byDim;
import mir.ndslice.slice : sliced;
void
I need to reproduce numpy sort for 2D array.
--
import numpy as np
a = [[1, -1, 3, 2], [0, -2, 3, 1]]
b = np.sort(a)
b
# array([[-1, 1, 2, 3],
#[-2, 0, 1, 3]])
--
Numpy sorted the array by columns, which visually