diff --git a/python/fate/arch/dataframe/_dataframe.py b/python/fate/arch/dataframe/_dataframe.py index e41927ef98..47427a5f87 100644 --- a/python/fate/arch/dataframe/_dataframe.py +++ b/python/fate/arch/dataframe/_dataframe.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import copy import operator from typing import List, Union @@ -537,6 +538,14 @@ def _merge_list(lhs, rhs): def iloc(self, indexes): ... + def copy(self) -> "DataFrame": + return DataFrame( + self._ctx, + self._block_table.mapValues(lambda v: v), + copy.deepcopy(self.partition_order_mappings), + self._data_manager.duplicate() + ) + @classmethod def hstack(cls, stacks: List["DataFrame"]) -> "DataFrame": from .ops._dimension_scaling import hstack