{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Welcome to Python and Ceteris LAB\n",
        "\n**Opening question:** How can one language carry an economic question from raw observations to a reproducible conclusion?\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "\n",
        "inflation = pd.DataFrame({\n",
        "    \"month\": [\"Jan\", \"Feb\", \"Mar\", \"Apr\"],\n",
        "    \"rate\": [2.9, 2.8, 2.7, 2.6],\n",
        "})\n",
        "print(inflation[\"rate\"].mean())\n",
        "print(inflation.tail(2))\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "**Interpretation check:** Interpretation. The mean summarizes the four observations, while the final rows preserve the temporal detail. A statistic and the underlying data answer different questions.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "principal = 1_000\n",
        "annual_rate = 0.045\n",
        "years = 3\n",
        "future_value = principal * (1 + annual_rate) ** years\n",
        "print(f\"Future value: ${future_value:,.2f}\")\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "**Interpretation check:** Interpretation. Clear names make the calculation readable as a small model rather than a string of unexplained numbers.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Verified source output\n",
        "\n",
        "```text\n2.7499999999999996 month rate 2 Mar 2.7 3 Apr 2.6\n```\n\n```text\nFuture value: $1,141.17\n```\n\n```text\n2.7499999999999996\n  month  rate\n2   Mar   2.7\n3   Apr   2.6\n```\n\n```text\nimport pandas as pd\ninflation = pd.DataFrame({\nprint(inflation[\"rate\"].mean())\nprint(inflation.tail(2))\nfuture_value = principal * (1 + annual_rate) ** years\nprint(f\"Future value: ${future_value:,.2f}\")\n```\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3"
    },
    "ceteris_lab": {
      "course_slug": "fundamentals-python-econometrics",
      "source_derived": true,
      "course_title": "Fundamentals of Python for Financial Econometrics",
      "chapter": 1,
      "source_origin": "source-derived"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
