{
  "id": 399573,
  "title": "Faster make-submission.csv",
  "url": "/competitions/denoising-shabby-pages/discussion/399573",
  "author_name": "cmaspi",
  "post_date": "2023-04-04T15:55:16.991000",
  "votes": 0,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Not the optimal but certainly must faster. Just change list to set in select_pixels method</p>\n<pre><code>def (img):\n    y,x = img.\n\n     = ()\n\n     i in ():\n        pixel = (.(y), .(x))\n\n         pixel not in :\n            .(pixel)\n\n     ()\n</code></pre>",
  "messages": [
    {
      "id": 2209306,
      "postDate": "2023-04-04T15:55:16.990Z",
      "content": "<p>Not the optimal but certainly must faster. Just change list to set in select_pixels method</p>\n<pre><code>def (img):\n    y,x = img.\n\n     = ()\n\n     i in ():\n        pixel = (.(y), .(x))\n\n         pixel not in :\n            .(pixel)\n\n     ()\n</code></pre>",
      "rawMarkdown": "Not the optimal but certainly must faster. Just change list to set in select_pixels method\n\n```python3\ndef select_pixels(img):\n    y,x = img.shape\n\n    pixels = set()\n\n    for i in range(10000):\n        pixel = (random.randrange(y), random.randrange(x))\n\n        if pixel not in pixels:\n            pixels.add(pixel)\n\n    return list(pixels)\n```"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2209306": "Not the optimal but certainly must faster. Just change list to set in select_pixels method\n\n```python3\ndef select_pixels(img):\n    y,x = img.shape\n\n    pixels = set()\n\n    for i in range(10000):\n        pixel = (random.randrange(y), random.randrange(x))\n\n        if pixel not in pixels:\n            pixels.add(pixel)\n\n    return list(pixels)\n```"
  }
}