have gotten an error while submitting csv file (the error is that malformed csv at line 16138,
and when i'm trying submitting another file it gives me an error like that, Missing entries for IDs 0OS9LVX X 2020-01-02, O0S9LVX X 2020-01-04 andd so on
As a final solution merge the SampleSubmission and your submission on 'Place_ID X Date' then set the target to target_y.
S = pd.merge(SampleSubmission, submission, on='Place_ID X Date', how='left')
S['target'] = S['target_y']
S = S[['Place_ID X Date', 'target']]
S.to_csv('sub.csv', index=False)
any one can help me, remains almost 3 hours for this compitetion to be closed
If you are using python, did you set index=False while converting your submission file to CSV?
yes i set it to false
so there are some values that are null, you can check them by submission.isna().sum().
you have to fill them with some value like 0. submission.fillna(0)
there is no null values, it gives 0 null values
that's odd.
As a final solution merge the SampleSubmission and your submission on 'Place_ID X Date' then set the target to target_y.
S = pd.merge(SampleSubmission, submission, on='Place_ID X Date', how='left') S['target'] = S['target_y'] S = S[['Place_ID X Date', 'target']] S.to_csv('sub.csv', index=False)sub = pd.read_csv('samplesubmission.csv') final step: submit = pd.DataFrame({'Place_ID X Date': sub['Place_ID X Date'], 'target': prediction}) from IPython.display import FileLink def create_submission(submission_file, submission_name): submission_file.to_csv(submission_name+".csv" , index=False) return FileLink(submission_name+".csv") create_submission(submit, 'samplesub')
kindly try this out
first step import the sample submission file
sub = pd.read_csv('samplesubmission.csv')
final step:
submit = pd.DataFrame({'Place_ID X Date': sub['Place_ID X Date'], 'target': prediction})
from IPython.display import FileLink
def create_submission(submission_file, submission_name):
submission_file.to_csv(submission_name+".csv" , index=False)
return FileLink(submission_name+".csv")
create_submission(submit, 'samplesub')
Thank you broo, it works now
Alright, that's good