我有一个大数据,所以我想检查一列充满文字的电话号码,因此,首先在每个单元格上拆分每个单词,然后检查每个单词是否包含3个和的len为10,但这效率不高。
a = data['observacion_int'].fillna('')
for i in range(0,len(a)):
a[i] = list(a[i].split())
import time
start = time.time()
b = ['']*len(a)
k = 0
for i in range(0,len(a)):
for j in range(0,len(a[i])):
if a[i][j][0] == '3':
if len(a[i][j]) == 10:
b[i] = a[i][j]
#break
end = time.time()
print(end - start)
如何使它更快?