@@ -473,35 +473,35 @@ def sort_index(a, dim=0, is_ascending=True):
473
473
c_uint_t (dim ), c_bool_t (is_ascending )))
474
474
return out ,idx
475
475
476
- def sort_by_key (iv , ik , dim = 0 , is_ascending = True ):
476
+ def sort_by_key (ik , iv , dim = 0 , is_ascending = True ):
477
477
"""
478
478
Sort an array based on specified keys
479
479
480
480
Parameters
481
481
----------
482
- iv : af.Array
483
- An Array containing the values
484
482
ik : af.Array
485
483
An Array containing the keys
484
+ iv : af.Array
485
+ An Array containing the values
486
486
dim: optional: int. default: 0
487
487
Dimension along which sort is to be performed.
488
488
is_ascending: optional: bool. default: True
489
489
Specifies the direction of the sort
490
490
491
491
Returns
492
492
-------
493
- (ov, ok): tuple of af.Array
494
- `ov` contains the values from `iv` after sorting them based on `ik`
493
+ (ok, ov): tuple of af.Array
495
494
`ok` contains the values from `ik` in sorted order
495
+ `ov` contains the values from `iv` after sorting them based on `ik`
496
496
497
497
Note
498
498
-------
499
499
Currently `dim` is only supported for 0.
500
500
"""
501
501
ov = Array ()
502
502
ok = Array ()
503
- safe_call (backend .get ().af_sort_by_key (c_pointer (ov .arr ), c_pointer (ok .arr ),
504
- iv .arr , ik .arr , c_uint_t (dim ), c_bool_t (is_ascending )))
503
+ safe_call (backend .get ().af_sort_by_key (c_pointer (ok .arr ), c_pointer (ov .arr ),
504
+ ik .arr , iv .arr , c_uint_t (dim ), c_bool_t (is_ascending )))
505
505
return ov ,ok
506
506
507
507
def set_unique (a , is_sorted = False ):
0 commit comments