libs.domain.stats module¶
libs/domain/stats.py
- class libs.domain.stats.StatsDetailed¶
Bases:
object詳細データ
- __init__(mode=4, win=0, lose=0, draw=0, total_point=0.0, avg_point=0.0, rank1=0, rank2=0, rank3=0, rank4=0, flying=0, yakuman=0, rpoint_max=0, rpoint_min=0, point_max=0.0, point_min=0.0, score=0, score_rank1=0, score_rank2=0, score_rank3=0, score_rank4=0, top1_max=0, top1_cur=0, top2_max=0, top2_cur=0, top3_max=0, top3_cur=0, lose2_max=0, lose2_cur=0, lose3_max=0, lose3_cur=0, lose4_max=0, lose4_cur=0, first_game=1900-01-01 00:00:00.000000, last_game=1900-01-01 00:00:00.000000, first_comment=None, last_comment=None)¶
- Parameters:
mode (Literal[3, 4])
win (int)
lose (int)
draw (int)
total_point (float)
avg_point (float)
rank1 (int)
rank2 (int)
rank3 (int)
rank4 (int)
flying (int)
yakuman (int)
rpoint_max (int)
rpoint_min (int)
point_max (float)
point_min (float)
score (int)
score_rank1 (int)
score_rank2 (int)
score_rank3 (int)
score_rank4 (int)
top1_max (int)
top1_cur (int)
top2_max (int)
top2_cur (int)
top3_max (int)
top3_cur (int)
lose2_max (int)
lose2_cur (int)
lose3_max (int)
lose3_cur (int)
lose4_max (int)
lose4_cur (int)
first_game (ExtendedDatetime)
last_game (ExtendedDatetime)
first_comment (str | None)
last_comment (str | None)
- Return type:
None
- avg_balance(pattern)¶
平均収支計算
- Parameters:
pattern (str) – 計算パターン
- Returns:
計算結果
- Return type:
float
- avg_point: float = 0.0¶
平均ポイント
- best_record()¶
ベストレコード
- Return type:
str
- property count: int¶
ゲーム数
- draw: int = 0¶
引き分け数
- first_comment: str | None = None¶
最初の記録時間のコメント
- first_game: ExtendedDatetime = 1900-01-01 00:00:00.000000¶
最初の記録時間
- flying: int = 0¶
トビ数
- property flying_rate: float¶
トビ率
- last_comment: str | None = None¶
最後の記録時間のコメント
- last_game: ExtendedDatetime = 1900-01-01 00:00:00.000000¶
最後の記録時間
- lose: int = 0¶
負け数
- lose2_cur: int = 0¶
連続1位なし最終値(現在値)
- lose2_max: int = 0¶
連続1位なし最大値
- lose3_cur: int = 0¶
連続逆連対最終値(現在値)
- lose3_max: int = 0¶
連続逆連対最大値
- lose4_cur: int = 0¶
連続ラス最終値(現在値)
- lose4_max: int = 0¶
連続ラス最大値
- mode: Literal[3, 4] = 4¶
集計モード
- point_max: float = 0.0¶
最大獲得ポイント
- point_min: float = 0.0¶
最小獲得ポイント
- rank1: int = 0¶
1位獲得数
- property rank1_rate: float¶
1位獲得率
- rank2: int = 0¶
2位獲得数
- property rank2_rate: float¶
2位獲得率
- rank3: int = 0¶
3位獲得数
- property rank3_rate: float¶
3位獲得率
- rank4: int = 0¶
4位獲得数
- property rank4_rate: float¶
4位獲得率
- property rank_avg: float¶
平均順位
- property rank_distr: str¶
順位分布(+平均順位)
- property rank_distr2: str¶
順位分布(+ゲーム数)
- rpoint_max: int = 0¶
最大素点
- rpoint_min: int = 0¶
最小素点
- score: int = 0¶
最終素点合計
- score_rank1: int = 0¶
最終素点合計(1位終了時)
- score_rank2: int = 0¶
最終素点合計(2位終了時)
- score_rank3: int = 0¶
最終素点合計(3位終了時)
- score_rank4: int = 0¶
最終素点合計(4位終了時)
- top1_cur: int = 0¶
連続1位獲得最終値(現在値)
- top1_max: int = 0¶
連続1位獲得最大値
- top2_cur: int = 0¶
連続連対最終値(現在値)
- top2_max: int = 0¶
連続連対最大値
- top3_cur: int = 0¶
連続ラス回避最終値(現在値)
- top3_max: int = 0¶
連続ラス回避獲得最大値
- total_point: float = 0.0¶
通算ポイント
- update_from_dict(data)¶
辞書から値を更新
- Parameters:
data (dict[Any, Any]) – 更新データ(キーはフィールド名)
- Return type:
None
- war_record()¶
戦績結果
- Return type:
str
- win: int = 0¶
勝ち数
- worst_record()¶
ワーストレコード
- Return type:
str
- yakuman: int = 0¶
役満和了数
- property yakuman_rate: float¶
役満和了率
- class libs.domain.stats.StatsInfo¶
Bases:
object成績情報
- __init__(name='', seat0=<factory>, seat1=<factory>, seat2=<factory>, seat3=<factory>, seat4=<factory>, mode=4, rule_version=<factory>, starttime=1900-01-01 00:00:00.000000, endtime=1900-01-01 00:00:00.000000, search_word='', result_df=<factory>, record_df=<factory>)¶
- Parameters:
name (str)
seat0 (StatsDetailed)
seat1 (StatsDetailed)
seat2 (StatsDetailed)
seat3 (StatsDetailed)
seat4 (StatsDetailed)
mode (Literal[3, 4])
rule_version (list[str])
starttime (ExtendedDatetime)
endtime (ExtendedDatetime)
search_word (str)
result_df (DataFrame)
record_df (DataFrame)
- Return type:
None
- endtime: ExtendedDatetime = 1900-01-01 00:00:00.000000¶
- property flying_list: list[int]¶
座席別トビ率
- mode: Literal[3, 4] = 4¶
集計モード
- name: str = ''¶
プレイヤー名/チーム名
- property rank_avg_list: list[float]¶
座席別平均順位
- property rank_distr_list: list[str]¶
座席別順位分布(平均順位)
- property rank_distr_list2: list[str]¶
座席別順位分布(ゲーム数)
- read(params)¶
データ読み込み
- Parameters:
params (PlaceholderBuilder) – プレースホルダ
- Return type:
None
- record_df: DataFrame¶
- result_df: DataFrame¶
- rule_version: list[str]¶
ルールセット
- search_word: str = ''¶
- seat0: StatsDetailed¶
全席
- seat1: StatsDetailed¶
東家
- seat2: StatsDetailed¶
南家
- seat3: StatsDetailed¶
西家
- seat4: StatsDetailed¶
北家
- set_data(df)¶
集計結果取り込み
- Parameters:
df (pd.DataFrame) – 集計結果
- Return type:
None
- set_parameter(**kwargs)¶
パラメータ取り込み
- Parameters:
kwargs (Any)
- Return type:
None
- starttime: ExtendedDatetime = 1900-01-01 00:00:00.000000¶
- property summary: DataFrame¶
成績サマリ
- property yakuman_list: list[int]¶
座席別役満和了率