Am trying to get the occurrences of certain pattern based on Index in Dataframe , any help would be appreciated
Have manually added a column as Index and need to get occurrences of pattern based on Index and the column
dataset sample
a(index) d
pattern 1 test
pattern 1 test
pattern 1 test2
pattern 2 test3
pattern 2 test
pattern 2 test
expected output
Am looking to make a dataframe something like below with the above sample data
pattern test test2 test3
----------------------------------
pattern 1 2 1 0
pattern 2 2 0 1