I have a dataframe (called news). In this dataframe there are articles and in column 'content' there is every article's full text. In need to keep only the first 200 words from every article.
Asked
Active
Viewed 53 times
1
-
@KarlWilhelm: I'll remove your dupe comment from the other post then, seeing as you found the right browser tab :-) – Martijn Pieters Aug 05 '19 at 12:59
-
Try `news['content'].str.split().str[:200].str.join(' ')` – Chris Adams Aug 05 '19 at 13:08