{
  "id": 486695,
  "title": " Please tell me why I can't submit",
  "url": "/competitions/home-credit-credit-risk-model-stability/discussion/486695",
  "author_name": "kitsune",
  "post_date": "2024-03-26T03:36:27.854000",
  "votes": 0,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I'm working on kaggle notebook.<br>\n　<br>\nWhen I try to submit the prediction results: <code>df.to_csv(\"submission.csv\")</code><br>\nI get the error : <code>AttributeError: 'Index' object has no attribute '_format_native_types'</code>.<br>\nBut I don't know how to solve it.<br>\n　</p>\n<p>I found someone with the same error, but it didn't help.<br>\n<a href=\"https://www.kaggle.com/discussions/questions-and-answers/478257\" target=\"_blank\">https://www.kaggle.com/discussions/questions-and-answers/478257</a></p>\n<p>If any kaggler knows the solution please let me know…</p>",
  "messages": [
    {
      "id": 2716539,
      "postDate": "2024-03-26T04:45:55.510Z",
      "content": "<p>Hi,</p>\n<p>Can you post the result of df.dtypes?</p>\n<p>Try doing this:</p>\n<pre><code> polars  pl\n\npl.from_pandas(df.reset_index()).write_csv()\n</code></pre>\n<p>What is the output of:</p>\n<pre><code> pandas  pd\n\npd.show_versions()\n</code></pre>",
      "rawMarkdown": "Hi,\n\nCan you post the result of df.dtypes?\n\nTry doing this:\n```python\nimport polars as pl\n\npl.from_pandas(df.reset_index()).write_csv('submission.csv')\n```\n\nWhat is the output of:\n```python\nimport pandas as pd\n\npd.show_versions()\n```",
      "votes": 1,
      "replies": [
        {
          "id": 2716567,
          "postDate": "2024-03-26T05:27:43.810Z",
          "content": "<p>After rewriting all the previous code to polars, I was able to submit it.<br>\nthank you!!</p>\n<p>As a side note, the pandas version is 2.2.0 .</p>",
          "rawMarkdown": "After rewriting all the previous code to polars, I was able to submit it.\nthank you!!\n\nAs a side note, the pandas version is 2.2.0 ."
        }
      ]
    },
    {
      "id": 2716442,
      "postDate": "2024-03-26T03:41:17.943Z",
      "content": "<p>What I tried…<br>\n・submit with another DataFrame<br>\n・reset_index and set_index again<br>\n・update pandas and numpy<br>\n→Failure</p>",
      "rawMarkdown": "What I tried...\n・submit with another DataFrame\n・reset_index and set_index again\n・update pandas and numpy\n→Failure"
    },
    {
      "id": 2716440,
      "postDate": "2024-03-26T03:36:27.853Z",
      "content": "<p>I'm working on kaggle notebook.<br>\n　<br>\nWhen I try to submit the prediction results: <code>df.to_csv(\"submission.csv\")</code><br>\nI get the error : <code>AttributeError: 'Index' object has no attribute '_format_native_types'</code>.<br>\nBut I don't know how to solve it.<br>\n　</p>\n<p>I found someone with the same error, but it didn't help.<br>\n<a href=\"https://www.kaggle.com/discussions/questions-and-answers/478257\" target=\"_blank\">https://www.kaggle.com/discussions/questions-and-answers/478257</a></p>\n<p>If any kaggler knows the solution please let me know…</p>",
      "rawMarkdown": "I'm working on kaggle notebook.\n　\nWhen I try to submit the prediction results: `df.to_csv(\"submission.csv\")`\nI get the error : `AttributeError: 'Index' object has no attribute '_format_native_types'`.\nBut I don't know how to solve it.\n　\n\nI found someone with the same error, but it didn't help.\nhttps://www.kaggle.com/discussions/questions-and-answers/478257\n\nIf any kaggler knows the solution please let me know..."
    },
    {
      "id": 2726376,
      "postDate": "2024-04-01T06:42:00.957Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2716539,
      "author_name": "Antonio Félix",
      "author_url": "",
      "post_date": "2024-03-26T04:45:55.510000",
      "content": "<p>Hi,</p>\n<p>Can you post the result of df.dtypes?</p>\n<p>Try doing this:</p>\n<pre><code> polars  pl\n\npl.from_pandas(df.reset_index()).write_csv()\n</code></pre>\n<p>What is the output of:</p>\n<pre><code> pandas  pd\n\npd.show_versions()\n</code></pre>",
      "votes": 1,
      "replies": [
        {
          "id": 2716567,
          "author_name": "kitsune",
          "author_url": "",
          "post_date": "2024-03-26T05:27:43.810000",
          "content": "<p>After rewriting all the previous code to polars, I was able to submit it.<br>\nthank you!!</p>\n<p>As a side note, the pandas version is 2.2.0 .</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2716442,
      "author_name": "kitsune",
      "author_url": "",
      "post_date": "2024-03-26T03:41:17.943000",
      "content": "<p>What I tried…<br>\n・submit with another DataFrame<br>\n・reset_index and set_index again<br>\n・update pandas and numpy<br>\n→Failure</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2726376,
      "author_name": "",
      "author_url": "",
      "post_date": "2024-04-01T06:42:00.957000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2716539": "Hi,\n\nCan you post the result of df.dtypes?\n\nTry doing this:\n```python\nimport polars as pl\n\npl.from_pandas(df.reset_index()).write_csv('submission.csv')\n```\n\nWhat is the output of:\n```python\nimport pandas as pd\n\npd.show_versions()\n```",
    "2716442": "What I tried...\n・submit with another DataFrame\n・reset_index and set_index again\n・update pandas and numpy\n→Failure",
    "2716440": "I'm working on kaggle notebook.\n　\nWhen I try to submit the prediction results: `df.to_csv(\"submission.csv\")`\nI get the error : `AttributeError: 'Index' object has no attribute '_format_native_types'`.\nBut I don't know how to solve it.\n　\n\nI found someone with the same error, but it didn't help.\nhttps://www.kaggle.com/discussions/questions-and-answers/478257\n\nIf any kaggler knows the solution please let me know...",
    "2726376": ""
  }
}