I have a DataFrame with a column named players, I want to count all the players playing in that round for all the rows.
These values- simple5dd1bd72e209cf05624291cd, simple62d6fd3.....
Some of these rows have 3 values some have 4 some have 5. I want to count the number of values one row has. Every one of them is separated by comma (,) and start with simple.
df['PlayersCount'] = df['players'].str.count('simple')
I tried using this but I am getting NaN in PlayersCount Column.
tags = df2['players'].str.split(',')
df2['PlayersCount'] = len(tags)
I also tried this but it gives me 20777.
Sorry I could not make a sample dataframe for you guys, as I do not know how to.