MCPcopy Create free account
hub / github.com/javascriptdata/danfojs / unique

Method unique

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

* Returns a Series with only the unique value(s) in the original Series * @example * ``` * const sf = new Series([1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6]); * const sf2 = sf.unique(); * console.log(sf2.values); * //output [ 1, 2, 3, 4, 5, 6 ] * ```

()

Source from the content-addressed store, hash-verified

1079 * ```
1080 */
1081 unique(): Series {
1082 const newValues = new Set(this.values as ArrayType1D);
1083 let series = new Series(Array.from(newValues));
1084 return series;
1085 }
1086
1087 /**
1088 * Return the number of unique elements in a Series

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected