@@ -329,7 +329,8 @@ def _apply_columns(self, func):
329
329
330
330
return self ._constructor (
331
331
data = new_data , index = self .index , columns = self .columns ,
332
- default_fill_value = self .default_fill_value ).__finalize__ (self )
332
+ default_fill_value = self .default_fill_value ,
333
+ default_kind = self .default_kind ).__finalize__ (self )
333
334
334
335
def astype (self , dtype ):
335
336
return self ._apply_columns (lambda x : x .astype (dtype ))
@@ -575,7 +576,8 @@ def _combine_frame(self, other, func, fill_value=None, level=None):
575
576
576
577
return self ._constructor (data = new_data , index = new_index ,
577
578
columns = new_columns ,
578
- default_fill_value = new_fill_value
579
+ default_fill_value = new_fill_value ,
580
+ default_kind = self .default_kind ,
579
581
).__finalize__ (self )
580
582
581
583
def _combine_match_index (self , other , func , level = None ):
@@ -596,7 +598,6 @@ def _combine_match_index(self, other, func, level=None):
596
598
new_data [col ] = func (series .values , other .values )
597
599
598
600
# fill_value is a function of our operator
599
- fill_value = None
600
601
if isna (other .fill_value ) or isna (self .default_fill_value ):
601
602
fill_value = np .nan
602
603
else :
@@ -605,7 +606,8 @@ def _combine_match_index(self, other, func, level=None):
605
606
606
607
return self ._constructor (
607
608
new_data , index = new_index , columns = self .columns ,
608
- default_fill_value = fill_value ).__finalize__ (self )
609
+ default_fill_value = fill_value ,
610
+ default_kind = self .default_kind ).__finalize__ (self )
609
611
610
612
def _combine_match_columns (self , other , func , level = None , try_cast = True ):
611
613
# patched version of DataFrame._combine_match_columns to account for
@@ -629,7 +631,8 @@ def _combine_match_columns(self, other, func, level=None, try_cast=True):
629
631
630
632
return self ._constructor (
631
633
new_data , index = self .index , columns = union ,
632
- default_fill_value = self .default_fill_value ).__finalize__ (self )
634
+ default_fill_value = self .default_fill_value ,
635
+ default_kind = self .default_kind ).__finalize__ (self )
633
636
634
637
def _combine_const (self , other , func , errors = 'raise' , try_cast = True ):
635
638
return self ._apply_columns (lambda x : func (x , other ))
@@ -673,7 +676,8 @@ def _reindex_index(self, index, method, copy, level, fill_value=np.nan,
673
676
674
677
return self ._constructor (
675
678
new_series , index = index , columns = self .columns ,
676
- default_fill_value = self ._default_fill_value ).__finalize__ (self )
679
+ default_fill_value = self ._default_fill_value ,
680
+ default_kind = self .default_kind ).__finalize__ (self )
677
681
678
682
def _reindex_columns (self , columns , method , copy , level , fill_value = None ,
679
683
limit = None , takeable = False ):
@@ -693,7 +697,8 @@ def _reindex_columns(self, columns, method, copy, level, fill_value=None,
693
697
sdict = {k : v for k , v in compat .iteritems (self ) if k in columns }
694
698
return self ._constructor (
695
699
sdict , index = self .index , columns = columns ,
696
- default_fill_value = self ._default_fill_value ).__finalize__ (self )
700
+ default_fill_value = self ._default_fill_value ,
701
+ default_kind = self .default_kind ).__finalize__ (self )
697
702
698
703
def _reindex_with_indexers (self , reindexers , method = None , fill_value = None ,
699
704
limit = None , copy = False , allow_dups = False ):
@@ -725,8 +730,10 @@ def _reindex_with_indexers(self, reindexers, method=None, fill_value=None,
725
730
else :
726
731
new_arrays [col ] = self [col ]
727
732
728
- return self ._constructor (new_arrays , index = index ,
729
- columns = columns ).__finalize__ (self )
733
+ return self ._constructor (
734
+ new_arrays , index = index , columns = columns ,
735
+ default_fill_value = self .default_fill_value ,
736
+ default_kind = self .default_kind ).__finalize__ (self )
730
737
731
738
def _join_compat (self , other , on = None , how = 'left' , lsuffix = '' , rsuffix = '' ,
732
739
sort = False ):
0 commit comments