我有一个pandas数据框,其中一列包含网址列表。我正在尝试清洁并删除“ ...”
我大约有465万条记录,并且希望尽可能高效地执行此功能。
输入:
1 []
2 []
3 ['http://t.co…/']
4 ['https://t.co/']
5 ['http://t.co/…']
6 ['http://t.co/…']
7 ['http://t.co/', 'http://t…']
8 ['http://facebook.com/']
Name: urls, Length: 100, dtype: object
输出:
1 []
2 []
3 ['http://t.co/']
4 ['https://t.co/']
5 ['http://t.co/']
6 ['http://t.co/']
7 ['http://t.co/', 'http://t']
8 ['http://facebook.com/']
Name: urls, Length: 100, dtype: object
答案 0 :(得分:0)
Data1 ['urls'] = Data1 ['urls']。apply(lambda行:[i.replace('…','')for i in row))