siat 3.4.10__py3-none-any.whl → 3.4.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
siat/sector_china.py CHANGED
@@ -3199,9 +3199,9 @@ if __name__=='__main__':
3199
3199
 
3200
3200
  peers=stock_industry_peer_em(ticker,indicator="市盈率",rank=10)
3201
3201
 
3202
- def stock_peers_em(ticker,indicator="市盈率",rank=10, \
3202
+ def stock_peers_em(ticker='',indicator='',rank=10, \
3203
3203
  font_size="16px",facecolor="papayawhip", \
3204
- numberPerLine=7):
3204
+ numberPerLine=5):
3205
3205
  """
3206
3206
  功能:基于东方财富行业分类,查找股票所属的行业以及主要同行
3207
3207
  特点:行业分类较粗糙,略胜于无
@@ -3245,8 +3245,9 @@ def stock_peers_em(ticker,indicator="市盈率",rank=10, \
3245
3245
  indicator_col=i
3246
3246
  break
3247
3247
 
3248
- if indicator_col=='':
3249
- print(" #Warning(stock_peer_em): unsupported indicator",indicator)
3248
+ if indicator_col=='' or indicator=='':
3249
+ if indicator!='':
3250
+ print(" #Warning(stock_peer_em): unsupported indicator",indicator)
3250
3251
 
3251
3252
  remove_list=["序号","代码","名称"]
3252
3253
  cfg_col_list_tmp = [x for x in cfg_col_list if x not in remove_list]
@@ -3282,6 +3283,22 @@ def stock_peers_em(ticker,indicator="市盈率",rank=10, \
3282
3283
  rank_flag="后"
3283
3284
  df_disp=cfg[collist].tail(abs(rank))
3284
3285
 
3286
+ #强制显示所选股票
3287
+ if force_show_stock:
3288
+ #所选股票是否在其中?
3289
+ if not ticker[:6] in list(df_disp["代码"]):
3290
+ ticker_seq=cfg[cfg["代码"]==ticker[:6]]["序号"].values[0]
3291
+ seq1=ticker_seq-4; seq2=ticker_seq+5
3292
+ #如果超出开头
3293
+ if seq1 <=0:
3294
+ seq1=1; seq2=10
3295
+ #如果超出结尾
3296
+ if seq2 > len(cfg):
3297
+ seq2=len(cfg); seq1=len(cfg)-9
3298
+
3299
+ #注意:此处的&不能换为and
3300
+ df_disp=cfg[(cfg["序号"]>=seq1) & (cfg["序号"]<=seq2)][collist]
3301
+
3285
3302
  #制表
3286
3303
  tname=ticker_name(ticker)
3287
3304
  titletxt="行业板块及其上市公司排名:"+hangye+","+indicator_col+"("+rank_flag+str(abs(rank))+"名)"
@@ -3311,13 +3328,16 @@ if __name__=='__main__':
3311
3328
 
3312
3329
  ticker="600519.SS"
3313
3330
  indicator="市盈率"
3314
- rank=40
3331
+ rank=11
3332
+
3333
+ force_show_stock=True
3315
3334
 
3316
3335
  font_size="16px"; facecolor="papayawhip"; numberPerLine=7
3317
3336
 
3318
3337
 
3319
3338
  def concept_stocks_em(concept='',ticker='',indicator="市盈率",rank=10, \
3320
- font_size="16px",facecolor="papayawhip",numberPerLine=7):
3339
+ force_show_stock=False, \
3340
+ font_size="16px",facecolor="papayawhip",numberPerLine=5):
3321
3341
  """
3322
3342
  功能:基于东方财富概念板块,查找关键字相关概念以及股票业绩
3323
3343
  特点:概念板块划分细致,同一股票可能分属多个板块,与行业分类不同
@@ -3428,6 +3448,23 @@ def concept_stocks_em(concept='',ticker='',indicator="市盈率",rank=10, \
3428
3448
  rank_flag="后"
3429
3449
  df_disp=cfg[collist].tail(abs(rank))
3430
3450
 
3451
+ #强制显示所选股票
3452
+ if force_show_stock:
3453
+ #所选股票是否在其中?
3454
+ if not ticker[:6] in list(df_disp["代码"]):
3455
+ ticker_seq=cfg[cfg["代码"]==ticker[:6]]["序号"].values[0]
3456
+ seq1=ticker_seq-4; seq2=ticker_seq+5
3457
+ #如果超出开头
3458
+ if seq1 <=0:
3459
+ seq1=1; seq2=10
3460
+ #如果超出结尾
3461
+ if seq2 > len(cfg):
3462
+ seq2=len(cfg); seq1=len(cfg)-9
3463
+
3464
+ #注意:此处的&不能换为and
3465
+ df_disp=cfg[(cfg["序号"]>=seq1) & (cfg["序号"]<=seq2)][collist]
3466
+
3467
+
3431
3468
  #制表
3432
3469
  titletxt="概念板块及其上市公司排名:"+concept+","+indicator_col+"("+rank_flag+str(abs(rank))+"名)"
3433
3470
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.4.10
3
+ Version: 3.4.12
4
4
  Summary: Securities Investment Analysis Tools (siat)
5
5
  Home-page: https://pypi.org/project/siat/
6
6
  Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
@@ -94,7 +94,7 @@ siat/risk_evaluation.py,sha256=I6B3gty-t--AkDCO0tKF-291YfpnF-IkXcFjqNKCt9I,76286
94
94
  siat/risk_evaluation_test.py,sha256=YEXM96gKzTfwN4U61AS4Rr1tV7KgUvn4rRC6f3iMw9s,3731
95
95
  siat/risk_free_rate.py,sha256=ZMr4cHikPvXvywr54gGqiI3Nvb69am6tq3zj2hwzANE,12384
96
96
  siat/risk_free_rate_test.py,sha256=CpmhUf8aEAEZeNu4gvWP2Mz2dLoIgBX5bI41vfUBEr8,4285
97
- siat/sector_china.py,sha256=ASAIwlysX9HbS4C30gd6Uh7d1dWAQdRGQvUgJhtexm0,129147
97
+ siat/sector_china.py,sha256=dCBzhFUbCKZytRmtMcPCmrq6ktmXJ50FH6g48SMXlt8,130573
98
98
  siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
99
99
  siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
100
100
  siat/security_price2.py,sha256=65s64L68aRZdVVK3V8UYxdPd_JHMqgJ2FBJJX5MSW-Q,26174
@@ -139,7 +139,7 @@ siat/valuation_china.py,sha256=EkZQaVkoBjM0c4MCNbaX-bMnlG0e3FXeaWczZDnkptU,67784
139
139
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
140
140
  siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
141
141
  siat/yf_name.py,sha256=H1EM8YYXA8nQHIqsJlso0I3HKPiJLT3QujO4gRVQXWs,13945
142
- siat-3.4.10.dist-info/METADATA,sha256=gTlCZesag1aR19iTEb2e5ORaiOiAO2uJku9vpyRI7z8,7683
143
- siat-3.4.10.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
144
- siat-3.4.10.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
145
- siat-3.4.10.dist-info/RECORD,,
142
+ siat-3.4.12.dist-info/METADATA,sha256=4x-7hEFgcIpc91o197nqMAM8kxqCckIONyb5qWMpdO8,7683
143
+ siat-3.4.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
144
+ siat-3.4.12.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
145
+ siat-3.4.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5