Hi guys,
I have a list with this command: categories.loc[0,:]
which reads
0 related-1
1 request-0
2 offer-0
3 aid_related-0
Now I would like to append a Dataframe "categories" with these contents, except I don't want the last two symbols.
So the categories dataframe should have columns "related", "request", "offer" and "aid related" as new columns.
I tried this:
row = categories.loc[0,:]
for line in row:
categories=categories.apply[lambda x: line.str.split('-')[0])
which does not work.
Can anyone help?
Kingz
I have a list with this command: categories.loc[0,:]
which reads
0 related-1
1 request-0
2 offer-0
3 aid_related-0
Now I would like to append a Dataframe "categories" with these contents, except I don't want the last two symbols.
So the categories dataframe should have columns "related", "request", "offer" and "aid related" as new columns.
I tried this:
row = categories.loc[0,:]
for line in row:
categories=categories.apply[lambda x: line.str.split('-')[0])
which does not work.
Can anyone help?
Kingz