15
15
16
16
import numpy as np
17
17
18
- from pandas ._config import using_copy_on_write
19
-
20
18
from pandas .util ._decorators import cache_readonly
21
19
from pandas .util ._exceptions import find_stack_level
22
20
@@ -370,13 +368,6 @@ def concat(
370
368
0 1 2
371
369
1 3 4
372
370
"""
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
380
371
381
372
op = _Concatenator (
382
373
objs ,
@@ -387,7 +378,6 @@ def concat(
387
378
levels = levels ,
388
379
names = names ,
389
380
verify_integrity = verify_integrity ,
390
- copy = copy ,
391
381
sort = sort ,
392
382
)
393
383
@@ -411,7 +401,6 @@ def __init__(
411
401
names : list [HashableT ] | None = None ,
412
402
ignore_index : bool = False ,
413
403
verify_integrity : bool = False ,
414
- copy : bool = True ,
415
404
sort : bool = False ,
416
405
) -> None :
417
406
if isinstance (objs , (ABCSeries , ABCDataFrame , str )):
@@ -439,7 +428,6 @@ def __init__(
439
428
440
429
self .ignore_index = ignore_index
441
430
self .verify_integrity = verify_integrity
442
- self .copy = copy
443
431
444
432
objs , keys = self ._clean_keys_and_objs (objs , keys )
445
433
@@ -656,7 +644,7 @@ def get_result(self):
656
644
cons = sample ._constructor_expanddim
657
645
658
646
index , columns = self .new_axes
659
- df = cons (data , index = index , copy = self . copy )
647
+ df = cons (data , index = index , copy = False )
660
648
df .columns = columns
661
649
return df .__finalize__ (self , method = "concat" )
662
650
@@ -681,10 +669,8 @@ def get_result(self):
681
669
mgrs_indexers .append ((obj ._mgr , indexers ))
682
670
683
671
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
685
673
)
686
- if not self .copy and not using_copy_on_write ():
687
- new_data ._consolidate_inplace ()
688
674
689
675
out = sample ._constructor_from_mgr (new_data , axes = new_data .axes )
690
676
return out .__finalize__ (self , method = "concat" )
@@ -710,7 +696,6 @@ def _get_comb_axis(self, i: AxisInt) -> Index:
710
696
axis = data_axis ,
711
697
intersect = self .intersect ,
712
698
sort = self .sort ,
713
- copy = self .copy ,
714
699
)
715
700
716
701
@cache_readonly
0 commit comments