File size: 222 Bytes
feeb971
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pandas as pd

df = pd.read_csv('dataset.csv')['text'].values
res = [
    ' '.join(txt.split(' ')[:3])
    for txt in df
]

res_df = pd.DataFrame({
    'text':
    res
})

res_df.to_csv('startings.csv', index=False)