following the advice from the thread How to apply pos_tag_sents() to pandas dataframe efficiently I run the code to identify different pos for the text in one of my variables.
Now that I managed to create the column of interest - sub['POS'] - how do I extract my relevant information - all the NN - and create a column for each of them?
print(sub['POS'])
5 [(e-mail, JJ), (new, JJ), (delhi, NN), ((, (),...
4 [(bangladesh, JJ), (garment, NN), (unions, NNS...
41 [(listen, VB), (blaze, NN), (wrecks, NNS), (te...
10 [(11:49, CD), (am, VBP), (,, ,), (september, V...
17 [(listen, JJ), (two, CD), (events, NNS), (plan...
as an output, I would like a new column (here as 'NN'), that contains all the NN for each row.
df = pd.DataFrame(["delhi",
"garment" ,
"blaze",
NaN], columns=['NN'])