Store poker game data into dataframe

Viewed 21

I extracted lines from 4 txt files into a dataframe (col1: files col2:lines). The txt files contain Pluribus poker game data (see original article here: http://kevinwang.us/lets-analyze-pluribuss-hands/)

My goal is to store all these lines into a dataframe, where each row is one game, who’s in what seat, small blind, big blind, how much $$ was raised/bet/called in each of the hole/turn/River/flop rounds, and each players last move (call/raise/check/bet/fold) in every round.

I’ve figured out how to store the lines from poker hand till all players have received their 2 cards but I don’t know how to store the lines past that. I was thinking multiple while loops ie while line != “SHOWDOWN”{store in dataframe} but idk… Every game is different. For example, some games don’t reach a “river” round and some don’t reach a “showdown”.

Here’s example 1 of 1 poker game that reached the showdown round: PokerStars Hand #30007: Hold'em No Limit (50/100) - 2019/07/11 08:20:07 ET
Table 'Pluribus Session 30' 6-max (Play Money) Seat #6 is the button
Seat 1: Gogo (10000 in chips)
Seat 2: Budd (10000 in chips)
Seat 3: Eddie (10000 in chips)
Seat 4: Bill (10000 in chips)
Seat 5: Pluribus (10000 in chips)
Seat 6: MrWhite (10000 in chips)
Gogo: posts small blind 50
Budd: posts big blind 100
*** HOLE CARDS ***
Dealt to Gogo [5h Jc]
Dealt to Budd [Jd 9h]
Dealt to Eddie [6s 5c]
Dealt to Bill [Ah 7h]
Dealt to Pluribus [2s 2d]
Dealt to MrWhite [3h Ts]
Eddie: folds
Bill: raises 125 to 225
Pluribus: folds
MrWhite: folds
Gogo: folds
Budd: calls 125
*** FLOP *** [3s Jh 2h]
Budd: checks
Bill: bets 250
Budd: calls 250
*** TURN *** [3s Jh 2h] [Tc]
Budd: checks
Bill: bets 750
Budd: calls 750
*** RIVER *** [3s Jh 2h] [Tc] [Ks]
Budd: checks
Bill: checks
*** SHOWDOWN ***
Budd: shows [Jd 9h]
Budd collected 2500.0 from pot
*** SUMMARY ***
Total pot 2500 | Rake 0
Board [3s Jh 2h Tc Ks]
Seat 2: Budd showed [Jd 9h] and won
(2500.0)
Seat 4: Bill showed [Ah 7h] and lost

Here’s one where all but one folded right after their 2 cards were dealt:

PokerStars Hand #30006: Hold'em No Limit (50/100) - 2019/07/11 08:20:06 ET
Table 'Pluribus Session 30' 6-max (Play Money) Seat #6 is the button
Seat 1: MrWhite (10000 in chips)
Seat 2: Gogo (10000 in chips)
Seat 3: Budd (10000 in chips)
Seat 4: Eddie (10000 in chips)
Seat 5: Bill (10000 in chips)
Seat 6: Pluribus (10000 in chips)
MrWhite: posts small blind 50
Gogo: posts big blind 100
*** HOLE CARDS ***
Dealt to MrWhite [Qd 4c]
Dealt to Gogo [7h 9d]
Dealt to Budd [6s 3h]
Dealt to Eddie [7s 9c]
Dealt to Bill [Jc Kc]
Dealt to Pluribus [Ks 7c]
Budd: folds
Eddie: folds
Bill: raises 125 to 225
Pluribus: folds
MrWhite: folds
Gogo: folds
Uncalled bet (125) returned to Bill
Bill collected 250.0 from pot
*** SUMMARY ***
Total pot 250 | Rake 0

0 Answers
Related