MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / argSort

Method argSort

src/danfojs-base/core/series.ts:1637–1642  ·  view source on GitHub ↗

* Returns the integer indices that would sort the Series. * @param ascending Boolean indicating whether to sort in ascending order or not. Defaults to true * @example * ``` * const sf = new Series([3, 1, 2]); * const sf2 = sf.argSort(); * console.log(sf2.values); *

(options?: { ascending: boolean })

Source from the content-addressed store, hash-verified

1635 *
1636 */
1637 argSort(options?: { ascending: boolean }): Series {
1638 const { ascending } = { ascending: true, ...options }
1639 const sortedIndex = this.sortValues({ ascending });
1640 const sf = new Series(sortedIndex.index);
1641 return sf;
1642 }
1643
1644 /**
1645 * Returns integer position of the largest value in the Series.

Callers

nothing calls this directly

Calls 1

sortValuesMethod · 0.95

Tested by

no test coverage detected