* Makes a deep copy of a DataFrame. * @example * ``` * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']}) * const df2 = df.copy() * df2.print() * ```
()
| 2018 | * ``` |
| 2019 | */ |
| 2020 | copy(): DataFrame { |
| 2021 | let df = new DataFrame([...this.$data], { |
| 2022 | columns: [...this.columns], |
| 2023 | index: [...this.index], |
| 2024 | dtypes: [...this.dtypes], |
| 2025 | config: { ...this.$config } |
| 2026 | }); |
| 2027 | return df; |
| 2028 | } |
| 2029 | |
| 2030 | /** |
| 2031 | * Return a boolean, same-sized object indicating where elements are empty (NaN, undefined, null). |