(dp: number = 1, options?: { inplace: boolean })
| 1571 | */ |
| 1572 | round(dp: number, options?: { inplace: boolean }): DataFrame |
| 1573 | round(dp: number = 1, options?: { inplace: boolean }): DataFrame | void { |
| 1574 | const { inplace } = { inplace: false, ...options } |
| 1575 | |
| 1576 | if (this.$frameIsNotCompactibleForArithmeticOperation()) { |
| 1577 | throw Error("TypeError: round operation is not supported for string dtypes"); |
| 1578 | } |
| 1579 | |
| 1580 | if (typeof dp !== "number") { |
| 1581 | throw Error("ParamError: dp must be a number"); |
| 1582 | } |
| 1583 | |
| 1584 | const newData = utils.round(this.values as number[], dp, false); |
| 1585 | |
| 1586 | if (inplace) { |
| 1587 | this.$setValues(newData) |
| 1588 | } else { |
| 1589 | return new DataFrame( |
| 1590 | newData, |
| 1591 | { |
| 1592 | index: [...this.index], |
| 1593 | columns: [...this.columns], |
| 1594 | config: { ...this.config } |
| 1595 | }) |
| 1596 | } |
| 1597 | } |
| 1598 | |
| 1599 | /** |
| 1600 | * Returns cumulative product accross specified axis. |
nothing calls this directly
no test coverage detected