(value: number | string | boolean, options?: { inplace?: boolean })
| 784 | */ |
| 785 | fillNa(value: number | string | boolean, options?: { inplace?: boolean }): Series |
| 786 | fillNa(value: number | string | boolean, options?: { inplace?: boolean }): Series | void { |
| 787 | const { inplace } = { inplace: false, ...options } |
| 788 | |
| 789 | if (!value && typeof value !== "boolean" && typeof value !== "number") { |
| 790 | throw Error('ParamError: value must be specified'); |
| 791 | } |
| 792 | |
| 793 | const newValues: ArrayType1D = []; |
| 794 | (this.values as ArrayType1D).forEach((val) => { |
| 795 | if (utils.isEmpty(val)) { |
| 796 | newValues.push(value); |
| 797 | } else { |
| 798 | newValues.push(val); |
| 799 | } |
| 800 | }); |
| 801 | |
| 802 | if (inplace) { |
| 803 | this.$setValues(newValues) |
| 804 | } else { |
| 805 | return utils.createNdframeFromNewDataWithOldProps({ |
| 806 | ndFrame: this, |
| 807 | newData: newValues, |
| 808 | isSeries: true |
| 809 | }) as Series |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | |
| 814 | /** |
nothing calls this directly
no test coverage detected