{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# First Python Data Example\n",
        "\n",
        "Use Python to describe a wage and education relationship. Keep the interpretation descriptive."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "\n",
        "df = pd.read_csv(\"wage_sample.csv\")\n",
        "print(df[[\"wage\", \"education\", \"experience\"]].describe())"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "correlation = df[\"wage\"].corr(df[\"education\"])\n",
        "print(\"Correlation:\", round(correlation, 3))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "grouped = df.groupby(\"education\")[\"wage\"].mean()\n",
        "print(grouped)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Careful interpretation\n",
        "\n",
        "The output can describe an association in this sample. It should not be treated as proof that education causes wages to rise without stronger assumptions or research design."
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.11"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
