Financial Statement Analysis Project with Python

Data Analytics project 06

Financial Statement Analysis Project with Python

Build a complete financial statement analysis portfolio project with documented metrics, reproducible Python code, validation checks, and responsible interpretation.

Explore Data Analytics training in VizagView all project ideas

Business question

How have revenue growth, profit margins, current ratio, and debt-to-equity changed over time?

Dataset and grain

Four years of simplified synthetic income-statement and balance-sheet values.

Requirements

Python 3.10 or later with pandas installed.

Method and validation checks

Derive gross profit, operating profit, and net income from statement lines, divide by revenue for margins, and calculate liquidity, leverage, and growth ratios.

  • Profit identities reconcile to source lines
  • The first growth value remains missing without a prior year
  • Ratios keep consistent currency and period definitions
  • No cash-flow conclusion is inferred from accrual statement ratios

Complete Python code

Save the code as da_financial_statement_analysis.py. Review the stated model and field assumptions before using another dataset.

"""Analyse simplified synthetic income-statement and balance-sheet data."""

from __future__ import annotations

import pandas as pd


def demo_statements() -> pd.DataFrame:
    return pd.DataFrame({
        "year": [2022, 2023, 2024, 2025], "revenue": [8_400_000, 9_150_000, 10_400_000, 11_250_000],
        "cogs": [4_900_000, 5_250_000, 5_850_000, 6_200_000], "operating_expense": [2_100_000, 2_350_000, 2_650_000, 2_900_000],
        "interest": [180_000, 175_000, 160_000, 145_000], "tax": [290_000, 330_000, 405_000, 455_000],
        "current_assets": [3_100_000, 3_350_000, 3_700_000, 4_050_000], "current_liabilities": [1_750_000, 1_820_000, 1_960_000, 2_050_000],
        "total_debt": [2_900_000, 2_700_000, 2_450_000, 2_200_000], "equity": [3_600_000, 3_950_000, 4_450_000, 5_000_000],
    })


def analyse_statements(data: pd.DataFrame) -> pd.DataFrame:
    result = data.copy().sort_values("year")
    result["gross_profit"] = result["revenue"] - result["cogs"]
    result["operating_profit"] = result["gross_profit"] - result["operating_expense"]
    result["net_income"] = result["operating_profit"] - result["interest"] - result["tax"]
    result["gross_margin"] = result["gross_profit"] / result["revenue"]
    result["operating_margin"] = result["operating_profit"] / result["revenue"]
    result["net_margin"] = result["net_income"] / result["revenue"]
    result["current_ratio"] = result["current_assets"] / result["current_liabilities"]
    result["debt_to_equity"] = result["total_debt"] / result["equity"]
    result["revenue_growth"] = result["revenue"].pct_change()
    return result


def main() -> None:
    columns = ["year", "revenue_growth", "gross_margin", "operating_margin", "net_margin", "current_ratio", "debt_to_equity"]
    print(analyse_statements(demo_statements())[columns].round(3).to_string(index=False))
    print("Synthetic simplified statements; not accounting, audit, tax, or investment advice.")


if __name__ == "__main__":
    main()

Build and run the project

Run python da_financial_statement_analysis.py to calculate profitability, liquidity, leverage, and growth ratios.

  1. Confirm the source grain and field definitions.
  2. Reconcile record counts and additive totals.
  3. Validate rate denominators and date filters.
  4. Review outliers and missing values.
  5. Read the interpretation limits before sharing conclusions.

Expected analytical output

A yearly ratio table covering revenue growth, three profit margins, current ratio, and debt-to-equity.

Interpretation and responsible-use limits

The statements are synthetic and simplified. This is not accounting, audit, tax, credit, valuation, or investment advice; real interpretation requires complete notes and applicable standards.

Ways to extend the project

Add cash flow, EBITDA reconciliation, common-size statements, peer benchmarks, quarterly seasonality, and documented accounting-policy changes.

Continue learning Data Analytics

Try the next project, return to the Softenant project library, or explore the Data Analytics course in Vizag for guided SQL, Excel, Power BI, Python, dashboard, and portfolio practice.