python2.x与Python2.3遇到的坑

#有时候用2.x,有时候用3.x,所以偶尔会遇到一些不明的报错,感觉明明是对的啊,为什么一直报错呢?
#所以以后遇到类似的问题,都记录下。

csv_file_object = csv.reader(open("../input/train.csv"))
header = csv_file_object.__next__()#3.x要这样写,2.x直接.next()就行了

Ports = list(enumerate(np.unique(train_df['Embarked'].astype(str)))) python 3.x
Ports = list(enumerate(np.unique(train_df['Embarked']))) python 2.x
##############################################################################################

猜你喜欢

转载自blog.csdn.net/u011011025/article/details/53892884
今日推荐