train['DOB']
0 22/01/1952
1 31/08/1963
2 27/10/1980
3 22/10/1985
4 31/07/1975
5 18/04/1974
6 26/11/1977
7 1967-04-05 00:00:00
8 23/11/1951
import time
import dateutil.parser
for i in train:
i['DOB'] = i['DOB'].dateutil.parser.parse(train['DOB']).date()
TypeError跟踪(最近的呼叫 最后) 2导入dateutil.parser 3对于我在火车上: ----> 4 i ['DOB'] = i ['DOB']。dateutil.parser.parse(train ['DOB'])。date() 5 6
TypeError:字符串索引必须为整数