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

Method isNa

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

* Return a boolean same-sized object indicating where elements are NaN. * NaN and undefined values gets mapped to true, and everything else gets mapped to false. * @example * ``` * const sf = new Series([1, 2, 3, 4, NaN, 6]); * console.log(sf.isNaN()); * //output [ fals

()

Source from the content-addressed store, hash-verified

744 *
745 */
746 isNa(): Series {
747 const newData = this.values.map((value) => {
748
749 if (utils.isEmpty(value)) {
750 return true;
751 } else {
752 return false;
753 }
754 })
755 const sf = new Series(newData,
756 {
757 index: this.index,
758 dtypes: ["boolean"],
759 config: this.config
760 });
761 return sf;
762 }
763
764 /**
765 * Replace all missing values with a specified value

Callers 1

dropNaMethod · 0.95

Calls 2

isEmptyMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected