Skip to content

Commit

Permalink
dataframe: add copy interface
Browse files Browse the repository at this point in the history
Signed-off-by: mgqa34 <mgq3374541@163.com>
Signed-off-by: sagewe <wbwmat@gmail.com>
  • Loading branch information
mgqa34 authored and sagewe committed Jul 21, 2023
1 parent 8930aed commit a792198
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/fate/arch/dataframe/_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a792198

Please sign in to comment.