{
  "id": 276122,
  "title": "Player Height is Inconsistent",
  "url": "/competitions/nfl-big-data-bowl-2022/discussion/276122",
  "author_name": "",
  "post_date": "2021-10-03T09:03:36.682804600Z",
  "votes": 6,
  "comment_count": 5,
  "views": 0,
  "content": "<p>In the players.csv file, the height for the first few hundred players was in the format of [foot]-[inch]; however, for some players, the height was one number (such as nflId #38571, #46136, #38645, #40038, or 43576). Is this a typo, or is there a reason behind this? It matters for me because I am trying to convert it to IU units. Here is the code if it matters.</p>\n<pre><code>def siunits(uscs):\n    numbers = uscs.split(\"-\")\n    foot, inch = int(numbers[0]), int(numbers[1])\n    meter = (foot / 3.281) + (inch / 39.37)\n    return meter\n</code></pre>",
  "messages": [
    {
      "id": "1532680",
      "postDate": "10/03/2021 09:03:36",
      "content": "<p>In the players.csv file, the height for the first few hundred players was in the format of [foot]-[inch]; however, for some players, the height was one number (such as nflId #38571, #46136, #38645, #40038, or 43576). Is this a typo, or is there a reason behind this? It matters for me because I am trying to convert it to IU units. Here is the code if it matters.</p>\n<pre><code>def siunits(uscs):\n    numbers = uscs.split(\"-\")\n    foot, inch = int(numbers[0]), int(numbers[1])\n    meter = (foot / 3.281) + (inch / 39.37)\n    return meter\n</code></pre>",
      "rawMarkdown": "In the players.csv file, the height for the first few hundred players was in the format of [foot]-[inch]; however, for some players, the height was one number (such as nflId #38571, #46136, #38645, #40038, or 43576). Is this a typo, or is there a reason behind this? It matters for me because I am trying to convert it to IU units. Here is the code if it matters.\n```python\ndef siunits(uscs):\n    numbers = uscs.split(\"-\")\n    foot, inch = int(numbers[0]), int(numbers[1])\n    meter = (foot / 3.281) + (inch / 39.37)\n    return meter\n```",
      "votes": null
    },
    {
      "id": "1533511",
      "postDate": "10/04/2021 05:27:37",
      "content": "<p>The heights with a single number represent inches only. You can use code like this to convert the <code>height</code> column in a vectorized fashion (assuming pandas):</p>\n<pre><code>h_ft_in = (players.height.str.contains('-'), 'height')\nplayers.loc[h_ft_in] = players.loc[h_ft_in].str.split('-').str[0].astype(int)*12 \\\n    + players.loc[h_ft_in].str.split('-').str[1].astype(int)\nplayers['height'] = players.height.astype(int) / 39.37\n</code></pre>",
      "rawMarkdown": "The heights with a single number represent inches only. You can use code like this to convert the `height` column in a vectorized fashion (assuming pandas):\n\n```\nh_ft_in = (players.height.str.contains('-'), 'height')\nplayers.loc[h_ft_in] = players.loc[h_ft_in].str.split('-').str[0].astype(int)*12 \\\n    + players.loc[h_ft_in].str.split('-').str[1].astype(int)\nplayers['height'] = players.height.astype(int) / 39.37\n```",
      "votes": null
    },
    {
      "id": "1533726",
      "postDate": "10/04/2021 09:58:03",
      "content": "<p>Thank you! I have modified this code slightly to fit my needs, and it works perfectly! I appreciate your help.</p>",
      "rawMarkdown": "Thank you! I have modified this code slightly to fit my needs, and it works perfectly! I appreciate your help.",
      "votes": null
    },
    {
      "id": "1568650",
      "postDate": "11/03/2021 00:16:32",
      "content": "<p>Good question <a href=\"https://www.kaggle.com/richardkawasaki\" target=\"_blank\">@richardkawasaki</a>!</p>\n<p>Our team also noticed this and were curious about the same thing as you:</p>\n<blockquote>\n  <p>Is this a typo, or is there a reason behind this?</p>\n</blockquote>\n<p>In addition we noticed inconsistencies in the \"birthDate: Date of birth (YYYY-MM-DD)\" column. It has some values that are separated by dashes and others that are separated by forward slashes (e.g., Elijah Campbell [nflId=46501] is 08/24/1995).</p>\n<p>Was this also a typo, or is there a reason behind it?</p>",
      "rawMarkdown": "Good question @richardkawasaki!\n\nOur team also noticed this and were curious about the same thing as you:\n\n> Is this a typo, or is there a reason behind this?\n\nIn addition we noticed inconsistencies in the \"birthDate: Date of birth (YYYY-MM-DD)\" column. It has some values that are separated by dashes and others that are separated by forward slashes (e.g., Elijah Campbell [nflId=46501] is 08/24/1995).\n\nWas this also a typo, or is there a reason behind it?",
      "votes": null
    },
    {
      "id": "1569710",
      "postDate": "11/03/2021 17:07:41",
      "content": "<p>There is no reason in particular - the difference here is random. You can use a string replace command if you want all the birthdates to be consistent.</p>",
      "rawMarkdown": "There is no reason in particular - the difference here is random. You can use a string replace command if you want all the birthdates to be consistent.",
      "votes": null
    },
    {
      "id": "1593464",
      "postDate": "11/24/2021 00:19:13",
      "content": "<p>Okay. Will do. Thanks <a href=\"https://www.kaggle.com/tombliss\" target=\"_blank\">@tombliss</a>!</p>",
      "rawMarkdown": "Okay. Will do. Thanks @tombliss!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1533511,
      "author_name": "jpmiller",
      "author_url": "",
      "post_date": "10/04/2021 05:27:37",
      "content": "<p>The heights with a single number represent inches only. You can use code like this to convert the <code>height</code> column in a vectorized fashion (assuming pandas):</p>\n<pre><code>h_ft_in = (players.height.str.contains('-'), 'height')\nplayers.loc[h_ft_in] = players.loc[h_ft_in].str.split('-').str[0].astype(int)*12 \\\n    + players.loc[h_ft_in].str.split('-').str[1].astype(int)\nplayers['height'] = players.height.astype(int) / 39.37\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 1533726,
          "author_name": "richardkawasaki",
          "author_url": "",
          "post_date": "10/04/2021 09:58:03",
          "content": "<p>Thank you! I have modified this code slightly to fit my needs, and it works perfectly! I appreciate your help.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1568650,
      "author_name": "danoff",
      "author_url": "",
      "post_date": "11/03/2021 00:16:32",
      "content": "<p>Good question <a href=\"https://www.kaggle.com/richardkawasaki\" target=\"_blank\">@richardkawasaki</a>!</p>\n<p>Our team also noticed this and were curious about the same thing as you:</p>\n<blockquote>\n  <p>Is this a typo, or is there a reason behind this?</p>\n</blockquote>\n<p>In addition we noticed inconsistencies in the \"birthDate: Date of birth (YYYY-MM-DD)\" column. It has some values that are separated by dashes and others that are separated by forward slashes (e.g., Elijah Campbell [nflId=46501] is 08/24/1995).</p>\n<p>Was this also a typo, or is there a reason behind it?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1569710,
          "author_name": "tombliss",
          "author_url": "",
          "post_date": "11/03/2021 17:07:41",
          "content": "<p>There is no reason in particular - the difference here is random. You can use a string replace command if you want all the birthdates to be consistent.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1593464,
          "author_name": "danoff",
          "author_url": "",
          "post_date": "11/24/2021 00:19:13",
          "content": "<p>Okay. Will do. Thanks <a href=\"https://www.kaggle.com/tombliss\" target=\"_blank\">@tombliss</a>!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1532680": "In the players.csv file, the height for the first few hundred players was in the format of [foot]-[inch]; however, for some players, the height was one number (such as nflId #38571, #46136, #38645, #40038, or 43576). Is this a typo, or is there a reason behind this? It matters for me because I am trying to convert it to IU units. Here is the code if it matters.\n```python\ndef siunits(uscs):\n    numbers = uscs.split(\"-\")\n    foot, inch = int(numbers[0]), int(numbers[1])\n    meter = (foot / 3.281) + (inch / 39.37)\n    return meter\n```",
    "1533511": "The heights with a single number represent inches only. You can use code like this to convert the `height` column in a vectorized fashion (assuming pandas):\n\n```\nh_ft_in = (players.height.str.contains('-'), 'height')\nplayers.loc[h_ft_in] = players.loc[h_ft_in].str.split('-').str[0].astype(int)*12 \\\n    + players.loc[h_ft_in].str.split('-').str[1].astype(int)\nplayers['height'] = players.height.astype(int) / 39.37\n```",
    "1533726": "Thank you! I have modified this code slightly to fit my needs, and it works perfectly! I appreciate your help.",
    "1568650": "Good question @richardkawasaki!\n\nOur team also noticed this and were curious about the same thing as you:\n\n> Is this a typo, or is there a reason behind this?\n\nIn addition we noticed inconsistencies in the \"birthDate: Date of birth (YYYY-MM-DD)\" column. It has some values that are separated by dashes and others that are separated by forward slashes (e.g., Elijah Campbell [nflId=46501] is 08/24/1995).\n\nWas this also a typo, or is there a reason behind it?",
    "1569710": "There is no reason in particular - the difference here is random. You can use a string replace command if you want all the birthdates to be consistent.",
    "1593464": "Okay. Will do. Thanks @tombliss!"
  },
  "source": "meta"
}