@@ -482,8 +482,8 @@ def _get_akshare_data(self, symbol: str, start_date: str, end_date: str) -> str:
482
482
result += f"数据期间: { start_date } 至 { end_date } \n "
483
483
result += f"数据条数: { len (data )} 条\n \n "
484
484
485
- # 显示更多数据:最近10天或全部数据(如果少于10天)
486
- display_rows = min (10 , len (data ))
485
+ # 显示最新3天数据,确保在各种显示环境下都能完整显示
486
+ display_rows = min (3 , len (data ))
487
487
result += f"最新{ display_rows } 天数据:\n "
488
488
489
489
# 使用pandas选项确保显示完整数据
@@ -493,8 +493,8 @@ def _get_akshare_data(self, symbol: str, start_date: str, end_date: str) -> str:
493
493
'display.max_colwidth' , None ):
494
494
result += data .tail (display_rows ).to_string (index = False )
495
495
496
- # 如果数据超过10天 ,也显示一些统计信息
497
- if len (data ) > 10 :
496
+ # 如果数据超过3天 ,也显示一些统计信息
497
+ if len (data ) > 3 :
498
498
latest_price = data .iloc [- 1 ]['收盘' ] if '收盘' in data .columns else data .iloc [- 1 ].get ('close' , 'N/A' )
499
499
first_price = data .iloc [0 ]['收盘' ] if '收盘' in data .columns else data .iloc [0 ].get ('close' , 'N/A' )
500
500
if latest_price != 'N/A' and first_price != 'N/A' :
@@ -532,8 +532,8 @@ def _get_baostock_data(self, symbol: str, start_date: str, end_date: str) -> str
532
532
result += f"数据期间: { start_date } 至 { end_date } \n "
533
533
result += f"数据条数: { len (data )} 条\n \n "
534
534
535
- # 显示更多数据:最近10天或全部数据(如果少于10天)
536
- display_rows = min (10 , len (data ))
535
+ # 显示最新3天数据,确保在各种显示环境下都能完整显示
536
+ display_rows = min (3 , len (data ))
537
537
result += f"最新{ display_rows } 天数据:\n "
538
538
539
539
# 使用pandas选项确保显示完整数据
0 commit comments