@@ -374,7 +374,7 @@ def recovery_periods(self) -> pd.Series:
374374 # Max recovery period date should not be in the border (it's not recovered)
375375 max_period = s2 .max () if s2 .idxmax ().to_timestamp () != self .last_date else np .NAN
376376 ser = pd .Series (max_period , index = [name ])
377- max_recovery_periods = max_recovery_periods . append ( ser )
377+ max_recovery_periods = pd . concat ([ max_recovery_periods , ser ] )
378378 return max_recovery_periods
379379
380380 def get_cagr (self , period : Optional [int ] = None , real : bool = False ) -> pd .Series :
@@ -692,7 +692,7 @@ def describe(
692692 ytd_return = self .get_cumulative_return (period = "YTD" )
693693 row = ytd_return .to_dict ()
694694 row .update (period = "YTD" , property = "Compound return" )
695- description = description . append (row , ignore_index = True )
695+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
696696 # CAGR for a list of periods
697697 if self .pl .years >= 1 :
698698 for i in years :
@@ -702,32 +702,32 @@ def describe(
702702 else :
703703 row = {x : None for x in df .columns }
704704 row .update (period = f"{ i } years" , property = "CAGR" )
705- description = description . append (row , ignore_index = True )
705+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
706706 # CAGR for full period
707707 row = self .get_cagr (period = None ).to_dict ()
708708 row .update (period = self ._pl_txt , property = "CAGR" )
709- description = description . append (row , ignore_index = True )
709+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
710710 # Dividend Yield
711711 row = self .assets_dividend_yield .iloc [- 1 ].to_dict ()
712712 row .update (period = "LTM" , property = "Dividend yield" )
713- description = description . append (row , ignore_index = True )
713+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
714714 # risk for full period
715715 row = self .risk_annual .to_dict ()
716716 row .update (period = self ._pl_txt , property = "Risk" )
717- description = description . append (row , ignore_index = True )
717+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
718718 # CVAR
719719 if self .pl .years >= 1 :
720720 row = self .get_cvar_historic ().to_dict ()
721721 row .update (period = self ._pl_txt , property = "CVAR" )
722- description = description . append (row , ignore_index = True )
722+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
723723 # max drawdowns
724724 row = self .drawdowns .min ().to_dict ()
725725 row .update (period = self ._pl_txt , property = "Max drawdowns" )
726- description = description . append (row , ignore_index = True )
726+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
727727 # max drawdowns dates
728728 row = self .drawdowns .idxmin ().to_dict ()
729729 row .update (period = self ._pl_txt , property = "Max drawdowns dates" )
730- description = description . append (row , ignore_index = True )
730+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
731731 # inception dates
732732 row = {}
733733 for ti in self .symbols :
@@ -737,7 +737,7 @@ def describe(
737737 row .update (period = None , property = "Inception date" )
738738 if hasattr (self , "inflation" ):
739739 row .update ({self .inflation : self .inflation_first_date .strftime ("%Y-%m" )})
740- description = description . append (row , ignore_index = True )
740+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
741741 # last asset date
742742 row = {}
743743 for ti in self .symbols :
@@ -747,11 +747,11 @@ def describe(
747747 row .update (period = None , property = "Last asset date" )
748748 if hasattr (self , "inflation" ):
749749 row .update ({self .inflation : self .inflation_last_date .strftime ("%Y-%m" )})
750- description = description . append (row , ignore_index = True )
750+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
751751 # last data date
752752 row = {x : self .last_date .strftime ("%Y-%m" ) for x in df .columns }
753753 row .update (period = None , property = "Common last data date" )
754- description = description . append (row , ignore_index = True )
754+ description = pd . concat ([ description , pd . DataFrame (row , index = [ 0 ])] , ignore_index = True )
755755 # rename columns
756756 if hasattr (self , "inflation" ):
757757 description .rename (columns = {self .inflation : "inflation" }, inplace = True )
@@ -1015,7 +1015,7 @@ def tracking_difference_annual(self) -> pd.DataFrame:
10151015 df = x [1 ]
10161016 wealth_index = helpers .Frame .get_wealth_indexes (df )
10171017 row = helpers .Index .tracking_difference (wealth_index ).iloc [[- 1 ]]
1018- result = result . append ( row , ignore_index = False )
1018+ result = pd . concat ([ result , row ] , ignore_index = False )
10191019 result .index = result .index .asfreq ('Y' )
10201020 return result
10211021
0 commit comments