python循环跳过异常示例(IndexError)
df = pd.DataFrame(["hdfs://hive/user/","hdfs:","hdfs://hive/user/"], columns=['location'])
for rw in df.iterrows():
try:
print(rw[1]['location'].split('/')[-1].split('.')[0],rw[1]['location'].split('/')[-1].split('.')[1])
except IndexError as e:
print ("IndexError Details : " + str(e))
pass