(options?: { inplace?: boolean })
| 1588 | */ |
| 1589 | dropNa(options?: { inplace?: boolean }): Series |
| 1590 | dropNa(options?: { inplace?: boolean }): Series | void { |
| 1591 | const { inplace } = { inplace: false, ...options } |
| 1592 | |
| 1593 | const oldValues = this.values; |
| 1594 | const oldIndex = this.index; |
| 1595 | const newValues: ArrayType1D = []; |
| 1596 | const newIndex: Array<string | number> = []; |
| 1597 | const isNaVals = this.isNa().values; |
| 1598 | |
| 1599 | isNaVals.forEach((val, i) => { |
| 1600 | if (!val) { |
| 1601 | newValues.push((oldValues as ArrayType1D)[i]); |
| 1602 | newIndex.push(oldIndex[i]) |
| 1603 | } |
| 1604 | }); |
| 1605 | |
| 1606 | if (inplace) { |
| 1607 | this.$setValues(newValues, false) |
| 1608 | this.$setIndex(newIndex) |
| 1609 | } else { |
| 1610 | const sf = this.copy(); |
| 1611 | sf.$setValues(newValues, false) |
| 1612 | sf.$setIndex(newIndex) |
| 1613 | return sf; |
| 1614 | } |
| 1615 | |
| 1616 | } |
| 1617 | |
| 1618 | /** |
| 1619 | * Returns the integer indices that would sort the Series. |
nothing calls this directly
no test coverage detected