I am getting submission error in Kaggle ERROR: Column '' was not expected (Line 1, Column 1)
when I am submitting my final .csv file
Asked
Active
Viewed 5,051 times
0

Pranay Aryal
- 5,208
- 4
- 30
- 41
-
1can you please share the head of your csv file? – nimrodz Jun 14 '18 at 03:45
-
@nimrodz I have added the answer which worked for this specific error. But you are right. The head of file could give a clue. – Pranay Aryal Jun 14 '18 at 03:47
3 Answers
3
Try adding index=False while saving csv like so:
output.to_csv("output.csv", index=False)

Jakub Królak
- 63
- 1
- 8
1
df_for_submission.to_csv('submission.csv', index=False)

Pranay Aryal
- 5,208
- 4
- 30
- 41
-
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - [From Review](/review/low-quality-posts/20349417) – Busti Jul 19 '18 at 16:11
-
@Busti I'm afraid this is the complete answer to the question. What do you think is the complete answer to this question? If you have one you can post it below. – Pranay Aryal Jul 19 '18 at 16:49
0
Try this:
result_df.to_csv('Submission_file_name.csv', index=False , header = 1)

Shivani Sinha
- 1
- 3