import io
with io.open('../output/submission_{}.csv'.format('22-Sep-2018-Try-Something_with_re'), 'w', newline='\n') as of:
of.write('fullVisitorId,PredictedLogRevenue\n')
for ind in out_log.index:
of.write('{},{}\n'.format(ind, out_log['PredictedLogRevenue'][ind]))
以下是提交给Kaggle的文件。希望你会发现它有用。我不得不自己编写输出循环,因为pandas坚持要同时添加CR和LF,这给Kaagle带来了问题。在
主要要注意的是io.打开,在open调用中设置newline='\n',并在每个write调用的末尾添加'\n'。在
相关问题 更多 >
编程相关推荐