* 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
()
| 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 |