@@ -524,7 +524,7 @@ def save_result(
524
524
:type file_name: str
525
525
:param decimals: decimals in csv
526
526
:type decimals: int
527
- :param file_format: format of account status, csv | feather
527
+ :param file_format: format of account status, csv | pickle
528
528
:return: A list of saved file path
529
529
:rtype: List[str]
530
530
"""
@@ -538,10 +538,10 @@ def save_result(
538
538
# save account file
539
539
if file_format == "csv" :
540
540
account_file_path = os .path .join (path , file_name_head + ".account.csv" )
541
- elif file_format == "feather " :
542
- account_file_path = os .path .join (path , file_name_head + ".account.feather " )
541
+ elif file_format == "pickle " :
542
+ account_file_path = os .path .join (path , file_name_head + ".account.pkl " )
543
543
else :
544
- raise RuntimeError ("File format should be csv or feather " )
544
+ raise RuntimeError ("File format should be csv or pickle " )
545
545
546
546
df_2_save : pd .DataFrame = self ._account_status_df
547
547
if decimals is not None :
@@ -550,8 +550,8 @@ def save_result(
550
550
# df_2_save = df_2_save.map(lambda x: round(x, decimals) if pd.api.types.is_numeric_dtype(type(x)) else x)
551
551
if file_format == "csv" :
552
552
df_2_save .to_csv (account_file_path )
553
- elif file_format == "feather " :
554
- df_2_save .to_feather (account_file_path )
553
+ elif file_format == "pickle " :
554
+ df_2_save .to_pickle (account_file_path , compression = "gzip" )
555
555
file_list .append (account_file_path )
556
556
557
557
# save backtest file
0 commit comments