From d241ce9b48fc0b709362309aa63c6efea2973a56 Mon Sep 17 00:00:00 2001 From: Ferenc Erki Date: Sat, 17 Jul 2010 00:15:27 +0200 Subject: [PATCH] Added new stat: fold to steal Added new stat: fold to steal Signed-off-by: steffen123 --- pyfpdb/Stats.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 72af0bb0..9bb6307c 100755 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -350,6 +350,29 @@ def f_BB_steal(stat_dict, player): 'fBB_s=NA', '(0/0)', '% folded BB to steal') + +def f_steal(stat_dict, player): + """ Folded blind to steal.""" + stat = 0.0 + try: + folded_blind = stat_dict[player]['sbnotdef'] + stat_dict[player]['bbnotdef'] + blind_stolen = stat_dict[player]['sbstolen'] + stat_dict[player]['bbstolen'] + + stat = float(folded_blind)/float(blind_stolen) + return (stat, + '%3.1f' % (100*stat) + '%', + 'fB=%3.1f' % (100*stat) + '%', + 'fB_s=%3.1f' % (100*stat) + '%', + '(%d/%d)' % (folded_blind, blind_stolen), + '% folded blind to steal' + ) + except: + return (stat, + 'NA', + 'fB=NA', + 'fB_s=NA', + '(0/0)', + '% folded blind to steal') def three_B(stat_dict, player): """ Three bet preflop/3rd.""" @@ -777,6 +800,7 @@ if __name__== "__main__": #print "player = ", player, do_stat(stat_dict, player = player, stat = 'steal') #print "player = ", player, do_stat(stat_dict, player = player, stat = 'f_SB_steal') #print "player = ", player, do_stat(stat_dict, player = player, stat = 'f_BB_steal') + #print "player = ", player, do_stat(stat_dict, player = player, stat = 'f_steal') #print "player = ", player, do_stat(stat_dict, player = player, stat = 'three_B') #print "player = ", player, do_stat(stat_dict, player = player, stat = 'WMsF') #print "player = ", player, do_stat(stat_dict, player = player, stat = 'a_freq1')