Skip to content

Net Debt TTM (average net debt over the trailing twelve months) #48

@JimChr-R4GN4R

Description

@JimChr-R4GN4R

Hello again!

It would be useful if you could add the TTM of net debt we take from balance_sheet.

Here is a workaround I have written in case is useful:

import pandas as pd

ticker = Ticker('GOOGL')
df = ticker.quarterly_balance_sheet().df()


long_term_debt = df[df["Breakdown"] == "Long Term Debt And Capital Lease Obligation"]
cash_and_sti   = df[df["Breakdown"] == "Cash, Cash Equivalents & Short Term Investments"]


long_term_debt = long_term_debt.drop(columns=["Breakdown"]).squeeze()
cash_and_sti   = cash_and_sti.drop(columns=["Breakdown"]).squeeze()

long_term_debt = pd.to_numeric(long_term_debt, errors="coerce")
cash_and_sti   = pd.to_numeric(cash_and_sti, errors="coerce")
net_debt = long_term_debt - cash_and_sti

result = pd.DataFrame({
    "Long Term Debt (M)": (long_term_debt / 1_000_000).round(3),
    "Cash & STI (M)": (cash_and_sti / 1_000_000).round(3),
    "Net Debt (M)": (net_debt / 1_000_000).round(3)
})

print(result.T)
                    2025-06-30  2025-03-31  2024-12-31  2024-09-30  2024-06-30  2024-03-31  2023-12-31  2023-09-30  2023-06-30  2023-03-31  2022-12-31  2022-09-30  2022-06-30
Long Term Debt (M)     35559.0     22564.0     22574.0     23951.0     24946.0     25185.0     24330.0     26331.0     26451.0         NaN         NaN         NaN     26431.0
Cash & STI (M)         95148.0     95328.0     95657.0     93230.0    100725.0    108090.0    110916.0    119935.0    118332.0         NaN         NaN         NaN    124997.0
Net Debt (M)          -59589.0    -72764.0    -73083.0    -69279.0    -75779.0    -82905.0    -86586.0    -93604.0    -91881.0         NaN         NaN         NaN    -98566.0

This shows the actual company's debt much clearer. :)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions