{
  "id": 149548,
  "title": "New to Kaggle, Help!!",
  "url": "/competitions/global-wheat-detection/discussion/149548",
  "author_name": "",
  "post_date": "2020-05-08T18:15:44.953549700Z",
  "votes": 2,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hey, I am new to kaggle. I got the csv created locally in my laptop and I am trying to copy paste the values I got to a csv. On submission, it gives 0.0000 score.\nI tried submitting the sample_submission.csv and got 0.0009 but when I write the same values as in the sample_submission.csv in a csv, I get 0.0000 score. So I think something goes wrong in the writing process. Please help!!!!</p>\n\n<p>fields=['image_id','PredictionString']\nrow3=[['aac893a91','1.0 0 0 50 50'],\n      ['51f1be19e','1.0 0 0 50 50'],\n      ['f5a1f0358','1.0 0 0 50 50'],\n      ['796707dd7','1.0 0 0 50 50'],\n      ['51b3e36ab','1.0 0 0 50 50'],\n      ['348a992bb','1.0 0 0 50 50'],\n      ['cc3532ff6','1.0 0 0 50 50'],\n      ['2fd875eaa','1.0 0 0 50 50'],\n      ['cb8d261a3','1.0 0 0 50 50'],\n      ['53f253011','1.0 0 0 50 50']\n     ]\nwith open(filename, 'w') as csvfile: <br>\n    # creating a csv writer object <br>\n    csvwriter = csv.writer(csvfile)  </p>\n\n<pre><code># writing the fields  \ncsvwriter.writerow(fields)  \n\n# writing the data rows  \ncsvwriter.writerows(row3)\n</code></pre>",
  "messages": [
    {
      "id": "838697",
      "postDate": "05/08/2020 18:15:44",
      "content": "<p>Hey, I am new to kaggle. I got the csv created locally in my laptop and I am trying to copy paste the values I got to a csv. On submission, it gives 0.0000 score.\nI tried submitting the sample_submission.csv and got 0.0009 but when I write the same values as in the sample_submission.csv in a csv, I get 0.0000 score. So I think something goes wrong in the writing process. Please help!!!!</p>\n\n<p>fields=['image_id','PredictionString']\nrow3=[['aac893a91','1.0 0 0 50 50'],\n      ['51f1be19e','1.0 0 0 50 50'],\n      ['f5a1f0358','1.0 0 0 50 50'],\n      ['796707dd7','1.0 0 0 50 50'],\n      ['51b3e36ab','1.0 0 0 50 50'],\n      ['348a992bb','1.0 0 0 50 50'],\n      ['cc3532ff6','1.0 0 0 50 50'],\n      ['2fd875eaa','1.0 0 0 50 50'],\n      ['cb8d261a3','1.0 0 0 50 50'],\n      ['53f253011','1.0 0 0 50 50']\n     ]\nwith open(filename, 'w') as csvfile: <br>\n    # creating a csv writer object <br>\n    csvwriter = csv.writer(csvfile)  </p>\n\n<pre><code># writing the fields  \ncsvwriter.writerow(fields)  \n\n# writing the data rows  \ncsvwriter.writerows(row3)\n</code></pre>",
      "rawMarkdown": "Hey, I am new to kaggle. I got the csv created locally in my laptop and I am trying to copy paste the values I got to a csv. On submission, it gives 0.0000 score.\nI tried submitting the sample_submission.csv and got 0.0009 but when I write the same values as in the sample_submission.csv in a csv, I get 0.0000 score. So I think something goes wrong in the writing process. Please help!!!!\n\n\nfields=['image_id','PredictionString']\nrow3=[['aac893a91','1.0 0 0 50 50'],\n      ['51f1be19e','1.0 0 0 50 50'],\n      ['f5a1f0358','1.0 0 0 50 50'],\n      ['796707dd7','1.0 0 0 50 50'],\n      ['51b3e36ab','1.0 0 0 50 50'],\n      ['348a992bb','1.0 0 0 50 50'],\n      ['cc3532ff6','1.0 0 0 50 50'],\n      ['2fd875eaa','1.0 0 0 50 50'],\n      ['cb8d261a3','1.0 0 0 50 50'],\n      ['53f253011','1.0 0 0 50 50']\n     ]\nwith open(filename, 'w') as csvfile:  \n    # creating a csv writer object  \n    csvwriter = csv.writer(csvfile)  \n        \n    # writing the fields  \n    csvwriter.writerow(fields)  \n        \n    # writing the data rows  \n    csvwriter.writerows(row3)",
      "votes": null
    },
    {
      "id": "838736",
      "postDate": "05/08/2020 18:45:50",
      "content": "<p>Usually people here use Pandas to deal with CSV data so I'm unfamiliar with \"csvwriter\". To accomplish what you're trying to do but with Pandas, you could do the following:\n<code>\nimport pandas as pd\ndf = pd.DataFrame(row3, columns=fields)\ndf.to_csv('submission.csv', index=False)\n</code>\nThat should produce a valid submission CSV.</p>",
      "rawMarkdown": "Usually people here use Pandas to deal with CSV data so I'm unfamiliar with \"csvwriter\". To accomplish what you're trying to do but with Pandas, you could do the following:\n```\nimport pandas as pd\ndf = pd.DataFrame(row3, columns=fields)\ndf.to_csv('submission.csv', index=False)\n```\nThat should produce a valid submission CSV.",
      "votes": null
    },
    {
      "id": "841310",
      "postDate": "05/10/2020 18:04:25",
      "content": "<p>Thanks <a href=\"/matthewmasters\">@matthewmasters</a> . I think the problem was because on submission the sample_submission was replaced by hidden tests.So dynamically reading the csv and submitting was fetching 0.0009 but hard coding was resulting in 0.0000.</p>",
      "rawMarkdown": "Thanks @matthewmasters . I think the problem was because on submission the sample_submission was replaced by hidden tests.So dynamically reading the csv and submitting was fetching 0.0009 but hard coding was resulting in 0.0000.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 838736,
      "author_name": "matthewmasters",
      "author_url": "",
      "post_date": "05/08/2020 18:45:50",
      "content": "<p>Usually people here use Pandas to deal with CSV data so I'm unfamiliar with \"csvwriter\". To accomplish what you're trying to do but with Pandas, you could do the following:\n<code>\nimport pandas as pd\ndf = pd.DataFrame(row3, columns=fields)\ndf.to_csv('submission.csv', index=False)\n</code>\nThat should produce a valid submission CSV.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 841310,
      "author_name": "aankita",
      "author_url": "",
      "post_date": "05/10/2020 18:04:25",
      "content": "<p>Thanks <a href=\"/matthewmasters\">@matthewmasters</a> . I think the problem was because on submission the sample_submission was replaced by hidden tests.So dynamically reading the csv and submitting was fetching 0.0009 but hard coding was resulting in 0.0000.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "838697": "Hey, I am new to kaggle. I got the csv created locally in my laptop and I am trying to copy paste the values I got to a csv. On submission, it gives 0.0000 score.\nI tried submitting the sample_submission.csv and got 0.0009 but when I write the same values as in the sample_submission.csv in a csv, I get 0.0000 score. So I think something goes wrong in the writing process. Please help!!!!\n\n\nfields=['image_id','PredictionString']\nrow3=[['aac893a91','1.0 0 0 50 50'],\n      ['51f1be19e','1.0 0 0 50 50'],\n      ['f5a1f0358','1.0 0 0 50 50'],\n      ['796707dd7','1.0 0 0 50 50'],\n      ['51b3e36ab','1.0 0 0 50 50'],\n      ['348a992bb','1.0 0 0 50 50'],\n      ['cc3532ff6','1.0 0 0 50 50'],\n      ['2fd875eaa','1.0 0 0 50 50'],\n      ['cb8d261a3','1.0 0 0 50 50'],\n      ['53f253011','1.0 0 0 50 50']\n     ]\nwith open(filename, 'w') as csvfile:  \n    # creating a csv writer object  \n    csvwriter = csv.writer(csvfile)  \n        \n    # writing the fields  \n    csvwriter.writerow(fields)  \n        \n    # writing the data rows  \n    csvwriter.writerows(row3)",
    "838736": "Usually people here use Pandas to deal with CSV data so I'm unfamiliar with \"csvwriter\". To accomplish what you're trying to do but with Pandas, you could do the following:\n```\nimport pandas as pd\ndf = pd.DataFrame(row3, columns=fields)\ndf.to_csv('submission.csv', index=False)\n```\nThat should produce a valid submission CSV.",
    "841310": "Thanks @matthewmasters . I think the problem was because on submission the sample_submission was replaced by hidden tests.So dynamically reading the csv and submitting was fetching 0.0009 but hard coding was resulting in 0.0000."
  },
  "source": "meta"
}