Primary competition visual

Trailblazers Kenyan Qualification Challenge

Helping Kenya
1 000 Zindi Points
Challenge completed ~3 years ago
Prediction
185 joined
13 active
Starti
Jun 24, 22
Closei
Sep 25, 22
Reveali
Sep 25, 22
User avatar
vaga29
i got this error when submitting a csv file
Help · 25 Sep 2022, 19:27 · 10

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

Discussion 10 answers
User avatar
vaga29

any one can help me, remains almost 3 hours for this compitetion to be closed

25 Sep 2022, 19:28
Upvotes 0
User avatar
J0NNY
Adama science and technology university

If you are using python, did you set index=False while converting your submission file to CSV?

User avatar
vaga29

yes i set it to false

User avatar
J0NNY
Adama science and technology university

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)

User avatar
vaga29

there is no null values, it gives 0 null values

User avatar
J0NNY
Adama science and technology university

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)
User avatar
Ebiendele
Federal university of technology akure

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')

User avatar
Ebiendele
Federal university of technology akure

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')

25 Sep 2022, 20:30
Upvotes 0
User avatar
vaga29

Thank you broo, it works now

User avatar
Ebiendele
Federal university of technology akure

Alright, that's good