FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 📘 Fincept Notebook — Financial Statement Ratios\n",
"\n",
"**Finance · Intermediate · ~18 min · pandas + numpy**\n",
"\n",
"Ratios turn raw financial statements into comparable signals about a company's health. We build a compact income statement and balance sheet for a fictional company, *Fincept Demo Corp*, then compute the four classic ratio families — liquidity, profitability, leverage, and efficiency — and interpret each one.\n",
"\n",
"**What you'll learn**\n",
"- How to represent an income statement and balance sheet as pandas structures\n",
"- Liquidity ratios (current, quick) and what they say about short-term solvency\n",
"- Profitability (margins, ROE, ROA) and leverage (debt-to-equity, interest coverage)\n",
"- Efficiency via asset turnover, and how to read a tidy ratio table\n",
"\n",
"> **Requires** `pandas` and `numpy` (bundled with Fincept Terminal's Python environment).\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. The financial statements\n",
"\n",
"We start with a small, self-contained dictionary of figures (all in $ thousands) for *Fincept Demo Corp*. The income statement flows from revenue down to net income; the balance sheet obeys the identity **Assets = Liabilities + Equity**. We load it into pandas Series so later cells can slice it cleanly. Each code cell re-embeds this dictionary so it can run on its own.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"fincept_title": "Statements"
},
"outputs": [],
"source": [
"try:\n",
" import numpy as np\n",
" import pandas as pd\n",
"except ImportError:\n",
" raise SystemExit(\"Fincept Notebook needs pandas + numpy — install with: pip install pandas numpy\")\n",
"\n",
"# Fincept Demo Corp — all figures in $ thousands\n",
"FIN = {\n",
" # Income statement\n",
" 'revenue': 12000.0,\n",
" 'cogs': 7200.0,\n",
" 'operating_expenses': 2400.0,\n",
" 'interest_expense': 300.0,\n",
" 'taxes': 540.0,\n",
" # Balance sheet — current assets\n",
" 'cash': 1500.0,\n",
" 'accounts_receivable': 1800.0,\n",
" 'inventory': 2200.0,\n",
" # Balance sheet — non-current assets\n",
" 'net_ppe': 6500.0,\n",
" # Balance sheet — liabilities\n",
" 'accounts_payable': 1400.0,\n",
" 'short_term_debt': 900.0,\n",
" 'long_term_debt': 3600.0,\n",
" # Balance sheet — equity\n",
" 'common_equity': 6600.0,\n",
"}\n",
"\n",
"# Build the income statement as a derived Series\n",
"gross_profit = FIN['revenue'] - FIN['cogs']\n",
"operating_income = gross_profit - FIN['operating_expenses']\n",
"pretax_income = operating_income - FIN['interest_expense']\n",
"net_income = pretax_income - FIN['taxes']\n",
"income_statement = pd.Series({\n",
" 'Revenue': FIN['revenue'],\n",
" 'COGS': -FIN['cogs'],\n",
" 'Gross profit': gross_profit,\n",
" 'Operating expenses': -FIN['operating_expenses'],\n",
" 'Operating income (EBIT)': operating_income,\n",
" 'Interest expense': -FIN['interest_expense'],\n",
" 'Pretax income': pretax_income,\n",
" 'Taxes': -FIN['taxes'],\n",
" 'Net income': net_income,\n",
"}, name='$000s')\n",
"\n",
"current_assets = FIN['cash'] + FIN['accounts_receivable'] + FIN['inventory']\n",
"total_assets = current_assets + FIN['net_ppe']\n",
"current_liabilities = FIN['accounts_payable'] + FIN['short_term_debt']\n",
"total_liabilities = current_liabilities + FIN['long_term_debt']\n",
"balance_sheet = pd.Series({\n",
" 'Cash': FIN['cash'],\n",
" 'Accounts receivable': FIN['accounts_receivable'],\n",
" 'Inventory': FIN['inventory'],\n",
" 'Total current assets': current_assets,\n",
" 'Net PP&E': FIN['net_ppe'],\n",
" 'TOTAL ASSETS': total_assets,\n",
" 'Current liabilities': current_liabilities,\n",
" 'Long-term debt': FIN['long_term_debt'],\n",
" 'Total liabilities': total_liabilities,\n",
" 'Common equity': FIN['common_equity'],\n",
" 'LIAB + EQUITY': total_liabilities + FIN['common_equity'],\n",
"}, name='$000s')\n",
"\n",
"print(\"FINCEPT DEMO CORP — Income Statement ($000s)\")\n",
"print(income_statement.round(1).to_string())\n",
"print()\n",
"print(\"FINCEPT DEMO CORP — Balance Sheet ($000s)\")\n",
"print(balance_sheet.round(1).to_string())\n",
"print()\n",
"print(f\"Balance check: Assets {total_assets:,.0f} == Liab+Equity {total_liabilities + FIN['common_equity']:,.0f}\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2. Liquidity ratios\n",
"\n",
"Liquidity ratios ask: *can the company cover its short-term bills?*\n",
"\n",
"- **Current ratio** = current assets / current liabilities. Above 1.0 means current assets exceed current obligations.\n",
"- **Quick (acid-test) ratio** = (current assets − inventory) / current liabilities. It strips out inventory, the least-liquid current asset, for a stricter test.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"fincept_title": "Liquidity"
},
"outputs": [],
"source": [
"try:\n",
" import numpy as np\n",
" import pandas as pd\n",
"except ImportError:\n",
" raise SystemExit(\"Fincept Notebook needs pandas + numpy — install with: pip install pandas numpy\")\n",
"\n",
"FIN = {\n",
" 'revenue': 12000.0, 'cogs': 7200.0, 'operating_expenses': 2400.0,\n",
" 'interest_expense': 300.0, 'taxes': 540.0,\n",
" 'cash': 1500.0, 'accounts_receivable': 1800.0, 'inventory': 2200.0,\n",
" 'net_ppe': 6500.0, 'accounts_payable': 1400.0, 'short_term_debt': 900.0,\n",
" 'long_term_debt': 3600.0, 'common_equity': 6600.0,\n",
"}\n",
"\n",
"current_assets = FIN['cash'] + FIN['accounts_receivable'] + FIN['inventory']\n",
"current_liabilities = FIN['accounts_payable'] + FIN['short_term_debt']\n",
"\n",
"current_ratio = current_assets / current_liabilities\n",
"quick_ratio = (current_assets - FIN['inventory']) / current_liabilities\n",
"\n",
"liquidity = pd.DataFrame({\n",
" 'Ratio': ['Current ratio', 'Quick ratio'],\n",
" 'Value': [current_ratio, quick_ratio],\n",
" 'Formula': ['CA / CL', '(CA - Inventory) / CL'],\n",
" 'Interpretation': [\n",
" 'Comfortable short-term cushion (>1.5 is healthy)',\n",
" 'Can meet current bills without selling inventory',\n",
" ],\n",
"})\n",
"liquidity['Value'] = liquidity['Value'].round(2)\n",
"print(\"LIQUIDITY RATIOS — Fincept Demo Corp\")\n",
"print(liquidity.to_string(index=False))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Profitability ratios\n",
"\n",
"Profitability ratios measure how much of each revenue dollar (or each dollar of capital) becomes profit.\n",
"\n",
"- **Gross / operating / net margin** = gross profit, EBIT, or net income divided by revenue.\n",
"- **ROA** = net income / total assets — return generated per dollar of assets.\n",
"- **ROE** = net income / common equity — return to shareholders.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"fincept_title": "Profitability"
},
"outputs": [],
"source": [
"try:\n",
" import numpy as np\n",
" import pandas as pd\n",
"except ImportError:\n",
" raise SystemExit(\"Fincept Notebook needs pandas + numpy — install with: pip install pandas numpy\")\n",
"\n",
"FIN = {\n",
" 'revenue': 12000.0, 'cogs': 7200.0, 'operating_expenses': 2400.0,\n",
" 'interest_expense': 300.0, 'taxes': 540.0,\n",
" 'cash': 1500.0, 'accounts_receivable': 1800.0, 'inventory': 2200.0,\n",
" 'net_ppe': 6500.0, 'accounts_payable': 1400.0, 'short_term_debt': 900.0,\n",
" 'long_term_debt': 3600.0, 'common_equity': 6600.0,\n",
"}\n",
"\n",
"gross_profit = FIN['revenue'] - FIN['cogs']\n",
"operating_income = gross_profit - FIN['operating_expenses']\n",
"pretax_income = operating_income - FIN['interest_expense']\n",
"net_income = pretax_income - FIN['taxes']\n",
"total_assets = FIN['cash'] + FIN['accounts_receivable'] + FIN['inventory'] + FIN['net_ppe']\n",
"\n",
"profitability = pd.DataFrame({\n",
" 'Ratio': ['Gross margin', 'Operating margin', 'Net margin', 'Return on assets (ROA)', 'Return on equity (ROE)'],\n",
" 'Value': [\n",
" gross_profit / FIN['revenue'],\n",
" operating_income / FIN['revenue'],\n",
" net_income / FIN['revenue'],\n",
" net_income / total_assets,\n",
" net_income / FIN['common_equity'],\n",
" ],\n",
" 'Interpretation': [\n",
" 'Share of revenue left after direct costs',\n",
" 'Profitability of core operations (pre-interest/tax)',\n",
" 'Bottom-line profit per revenue dollar',\n",
" 'Profit generated per dollar of assets',\n",
" 'Profit generated per dollar of shareholder equity',\n",
" ],\n",
"})\n",
"profitability['Value %'] = (profitability['Value'] * 100).round(1)\n",
"profitability = profitability[['Ratio', 'Value %', 'Interpretation']]\n",
"print(\"PROFITABILITY RATIOS — Fincept Demo Corp (all shown as %)\")\n",
"print(profitability.to_string(index=False))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Leverage & efficiency ratios\n",
"\n",
"**Leverage** ratios gauge how much the company relies on debt, and how easily it services it:\n",
"\n",
"- **Debt-to-equity** = total debt / common equity.\n",
"- **Interest coverage** = EBIT / interest expense — how many times operating profit covers interest.\n",
"\n",
"**Efficiency** ratios show how hard the asset base works:\n",
"\n",
"- **Asset turnover** = revenue / total assets — revenue produced per dollar of assets.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"fincept_title": "Leverage & efficiency"
},
"outputs": [],
"source": [
"try:\n",
" import numpy as np\n",
" import pandas as pd\n",
"except ImportError:\n",
" raise SystemExit(\"Fincept Notebook needs pandas + numpy — install with: pip install pandas numpy\")\n",
"\n",
"FIN = {\n",
" 'revenue': 12000.0, 'cogs': 7200.0, 'operating_expenses': 2400.0,\n",
" 'interest_expense': 300.0, 'taxes': 540.0,\n",
" 'cash': 1500.0, 'accounts_receivable': 1800.0, 'inventory': 2200.0,\n",
" 'net_ppe': 6500.0, 'accounts_payable': 1400.0, 'short_term_debt': 900.0,\n",
" 'long_term_debt': 3600.0, 'common_equity': 6600.0,\n",
"}\n",
"\n",
"gross_profit = FIN['revenue'] - FIN['cogs']\n",
"operating_income = gross_profit - FIN['operating_expenses'] # EBIT\n",
"total_assets = FIN['cash'] + FIN['accounts_receivable'] + FIN['inventory'] + FIN['net_ppe']\n",
"total_debt = FIN['short_term_debt'] + FIN['long_term_debt']\n",
"\n",
"debt_to_equity = total_debt / FIN['common_equity']\n",
"interest_coverage = operating_income / FIN['interest_expense']\n",
"asset_turnover = FIN['revenue'] / total_assets\n",
"\n",
"lev_eff = pd.DataFrame({\n",
" 'Family': ['Leverage', 'Leverage', 'Efficiency'],\n",
" 'Ratio': ['Debt-to-equity', 'Interest coverage', 'Asset turnover'],\n",
" 'Value': [debt_to_equity, interest_coverage, asset_turnover],\n",
" 'Unit': ['x', 'x', 'x'],\n",
" 'Interpretation': [\n",
" 'Debt is below equity — moderate leverage',\n",
" 'EBIT covers interest many times over — low default risk',\n",
" 'Each $1 of assets generates this much revenue',\n",
" ],\n",
"})\n",
"lev_eff['Value'] = lev_eff['Value'].round(2)\n",
"print(\"LEVERAGE & EFFICIENCY RATIOS — Fincept Demo Corp\")\n",
"print(lev_eff.to_string(index=False))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 5. Full ratio summary\n",
"\n",
"Finally, we assemble every ratio into one tidy DataFrame grouped by family — the kind of one-glance scorecard an analyst keeps next to the statements.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"fincept_title": "Summary table"
},
"outputs": [],
"source": [
"try:\n",
" import numpy as np\n",
" import pandas as pd\n",
"except ImportError:\n",
" raise SystemExit(\"Fincept Notebook needs pandas + numpy — install with: pip install pandas numpy\")\n",
"\n",
"FIN = {\n",
" 'revenue': 12000.0, 'cogs': 7200.0, 'operating_expenses': 2400.0,\n",
" 'interest_expense': 300.0, 'taxes': 540.0,\n",
" 'cash': 1500.0, 'accounts_receivable': 1800.0, 'inventory': 2200.0,\n",
" 'net_ppe': 6500.0, 'accounts_payable': 1400.0, 'short_term_debt': 900.0,\n",
" 'long_term_debt': 3600.0, 'common_equity': 6600.0,\n",
"}\n",
"\n",
"gross_profit = FIN['revenue'] - FIN['cogs']\n",
"operating_income = gross_profit - FIN['operating_expenses']\n",
"pretax_income = operating_income - FIN['interest_expense']\n",
"net_income = pretax_income - FIN['taxes']\n",
"current_assets = FIN['cash'] + FIN['accounts_receivable'] + FIN['inventory']\n",
"total_assets = current_assets + FIN['net_ppe']\n",
"current_liabilities = FIN['accounts_payable'] + FIN['short_term_debt']\n",
"total_debt = FIN['short_term_debt'] + FIN['long_term_debt']\n",
"\n",
"rows = [\n",
" ('Liquidity', 'Current ratio', current_assets / current_liabilities, 'x'),\n",
" ('Liquidity', 'Quick ratio', (current_assets - FIN['inventory']) / current_liabilities, 'x'),\n",
" ('Profitability', 'Gross margin', gross_profit / FIN['revenue'] * 100, '%'),\n",
" ('Profitability', 'Operating margin', operating_income / FIN['revenue'] * 100, '%'),\n",
" ('Profitability', 'Net margin', net_income / FIN['revenue'] * 100, '%'),\n",
" ('Profitability', 'ROA', net_income / total_assets * 100, '%'),\n",
" ('Profitability', 'ROE', net_income / FIN['common_equity'] * 100, '%'),\n",
" ('Leverage', 'Debt-to-equity', total_debt / FIN['common_equity'], 'x'),\n",
" ('Leverage', 'Interest coverage', operating_income / FIN['interest_expense'], 'x'),\n",
" ('Efficiency', 'Asset turnover', FIN['revenue'] / total_assets, 'x'),\n",
"]\n",
"summary = pd.DataFrame(rows, columns=['Family', 'Ratio', 'Value', 'Unit'])\n",
"summary['Value'] = summary['Value'].round(2)\n",
"print(\"FINCEPT DEMO CORP — RATIO SCORECARD\")\n",
"print(summary.to_string(index=False))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"*— Fincept Notebook · part of Fincept Terminal. Edit any cell and press Ctrl+Enter to run.*\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}