1515
1616import numpy as np
1717
18- from pandas ._config import using_copy_on_write
19-
2018from pandas .util ._decorators import cache_readonly
2119from pandas .util ._exceptions import find_stack_level
2220
@@ -370,13 +368,6 @@ def concat(
370368 0 1 2
371369 1 3 4
372370 """
373- if copy is None :
374- if using_copy_on_write ():
375- copy = False
376- else :
377- copy = True
378- elif copy and using_copy_on_write ():
379- copy = False
380371
381372 op = _Concatenator (
382373 objs ,
@@ -387,7 +378,6 @@ def concat(
387378 levels = levels ,
388379 names = names ,
389380 verify_integrity = verify_integrity ,
390- copy = copy ,
391381 sort = sort ,
392382 )
393383
@@ -411,7 +401,6 @@ def __init__(
411401 names : list [HashableT ] | None = None ,
412402 ignore_index : bool = False ,
413403 verify_integrity : bool = False ,
414- copy : bool = True ,
415404 sort : bool = False ,
416405 ) -> None :
417406 if isinstance (objs , (ABCSeries , ABCDataFrame , str )):
@@ -439,7 +428,6 @@ def __init__(
439428
440429 self .ignore_index = ignore_index
441430 self .verify_integrity = verify_integrity
442- self .copy = copy
443431
444432 objs , keys = self ._clean_keys_and_objs (objs , keys )
445433
@@ -656,7 +644,7 @@ def get_result(self):
656644 cons = sample ._constructor_expanddim
657645
658646 index , columns = self .new_axes
659- df = cons (data , index = index , copy = self . copy )
647+ df = cons (data , index = index , copy = False )
660648 df .columns = columns
661649 return df .__finalize__ (self , method = "concat" )
662650
@@ -681,10 +669,8 @@ def get_result(self):
681669 mgrs_indexers .append ((obj ._mgr , indexers ))
682670
683671 new_data = concatenate_managers (
684- mgrs_indexers , self .new_axes , concat_axis = self .bm_axis , copy = self . copy
672+ mgrs_indexers , self .new_axes , concat_axis = self .bm_axis , copy = False
685673 )
686- if not self .copy and not using_copy_on_write ():
687- new_data ._consolidate_inplace ()
688674
689675 out = sample ._constructor_from_mgr (new_data , axes = new_data .axes )
690676 return out .__finalize__ (self , method = "concat" )
@@ -710,7 +696,6 @@ def _get_comb_axis(self, i: AxisInt) -> Index:
710696 axis = data_axis ,
711697 intersect = self .intersect ,
712698 sort = self .sort ,
713- copy = self .copy ,
714699 )
715700
716701 @cache_readonly
0 commit comments