Skip to content

Commit

Permalink
feat: Use pandas concat instead of append (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
linsamtw committed Sep 24, 2023
1 parent 20a8b83 commit b6fb28b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions FinMind/strategies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,9 @@ def simulate(self):
dic_value["signal"] = signal
dic_value["CashEarningsDistribution"] = cash_div
dic_value["StockEarningsDistribution"] = stock_div
self._trade_detail = self._trade_detail.append(
dic_value, ignore_index=True
df_dic_value = pd.DataFrame(dic_value, index=[0])
self._trade_detail = pd.concat(
(self._trade_detail, df_dic_value), ignore_index=True
)

self._trade_detail["EverytimeTotalProfit"] = (
Expand Down

0 comments on commit b6fb28b

Please sign in to comment.