I have a really similar question to this one.
And i really wonder why my restult is: NaN
.
I have a dataframe which this column:
Action
Player[J♡, K♧] won the $5.40 main pot with a Straight
Player [5, 2] won the $21.00 main pot with a flush
and I want to built a new column with the cards, who got played:
[J♡, K♧]
[5, 2]
or even:
[J, K]
[5, 2]
However when I play around on regex and i use:
dfpot['cards'] = dfpot['Action'].str.extract(r'\[([A-Za-z0-9_]+)\]', expand=False)
I only got NaN
.