Files
learn-trading/defeatbeta_tutorial.ipynb
tomatocreamandClaude Sonnet 4.6 b5bf689e72 docs: add API references, mapping corrections, and verification script
- Add yfinance.org and defeatbeta-api.org reference docs
- Fix defeatbeta_mapping.org: deprecated yfinance property names
  (quarterly_financials→quarterly_income_stmt, financials→income_stmt),
  longName vs longBusinessSummary conceptual mismatch, cashflow note typo
- Add Mapping Limitations section with live verification results (AAPL):
  DuckDB 1.4.3 incompatibility, format differences, coverage gaps
- Add docs/test_mapping.py as runnable mapping verification script
- Add offline.py, persistent_cache.py, download_data.py, warmup_cache.py
  for offline/cached defeatbeta usage
- Add aapl_yfinance.py exploration script and quant.py scaffold
- Add .envrc (uv layout) and update pyproject.toml + uv.lock

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-26 15:33:21 +08:00

190 KiB

📈 DefeatBeta-API vs Yahoo Finance: Interactive Comparison

Welcome to this interactive notebook where we'll explore the DefeatBeta-API - an open-source alternative to Yahoo Finance's market data APIs with higher reliability.

🎯 What You'll Learn

  • How to use DefeatBeta-API for financial data analysis
  • Compare data structures and methods with Yahoo Finance
  • Explore unique features like earnings transcripts and DCF valuation
  • Test practical trading analysis scenarios

📦 Setup

In [1]:
# Import required libraries
import pandas as pd
import numpy as np
import time
import sys

# DefeatBeta-API
from defeatbeta_api.data.ticker import Ticker
from persistent_cache import enable_persistent_cache
enable_persistent_cache()

# Yahoo Finance (for comparison)
try:
    import yfinance as yf
    YFINANCE_AVAILABLE = True
    print("✅ yfinance is installed")
except ImportError:
    YFINANCE_AVAILABLE = False
    print("⚠️  yfinance not installed - install with: uv add yfinance")

print("✅ DefeatBeta-API imported successfully")
print(f"Python version: {sys.version.split()[0]}")
[nltk_data] Error loading punkt_tab: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed:
[nltk_data]     unable to get local issuer certificate (_ssl.c:1010)>
______      __           _    ______      _        
|  _  \    / _|         | |   | ___ \    | |       
| | | |___| |_ ___  __ _| |_  | |_/ / ___| |_ __ _ 
| | | / _ \  _/ _ \/ _` | __| | ___ \/ _ \ __/ _` |
| |/ /  __/ ||  __/ (_| | |_  | |_/ /  __/ || (_| |
|___/ \___|_| \___|\__,_|\__| \____/ \___|\__\__,_|
📈:: Data Update Time ::	2026-04-17 ::
📈:: Software Version ::	0.0.45      ::
[persistent_cache] cache → /home/df/.cache/defeatbeta
✅ yfinance is installed
✅ DefeatBeta-API imported successfully
Python version: 3.12.12

🏃‍♀️ 1. QUICK PERFORMANCE TEST

In [5]:
# Test query speed for both APIs
symbol = 'AAPL'

print("=" * 60)
print("PERFORMANCE COMPARISON: Fetching Price Data")
print("=" * 60)

# DefeatBeta
start = time.time()
db_ticker = Ticker(symbol)
db_price = db_ticker.price()
db_time = time.time() - start
print(f"\n✅ DefeatBeta: {db_time:.3f}s")
print(f"   Data shape: {db_price.shape}")

# Yahoo Finance
if YFINANCE_AVAILABLE:
    start = time.time()
    yf_ticker = yf.Ticker(symbol)
    yf_price = yf_ticker.history(period='max')
    yf_time = time.time() - start
    print(f"\n✅ Yahoo Finance: {yf_time:.3f}s")
    print(f"   Data shape: {yf_price.shape}")
============================================================
PERFORMANCE COMPARISON: Fetching Price Data
============================================================

✅ DefeatBeta: 0.019s
   Data shape: (7897, 7)

✅ Yahoo Finance: 0.276s
   Data shape: (11433, 7)

📊 2. PRICE DATA COMPARISON

In [6]:
# Compare price data structures
print("=" * 60)
print("PRICE DATA STRUCTURE COMPARISON")
print("=" * 60)

print("\n📌 DEFEATBETA API:")
print(f"   Type: {type(db_price).__name__}")
print(f"   Columns: {list(db_price.columns)}")
print(f"\n   Latest 3 rows:")
display(db_price.tail(10))

if YFINANCE_AVAILABLE:
    print("\n📌 YAHOO FINANCE:")
    print(f"   Type: {type(yf_price).__name__}")
    print(f"   Columns: {list(yf_price.columns)}")
    print(f"\n   Latest 3 rows:")
    display(yf_price.tail(10))
============================================================
PRICE DATA STRUCTURE COMPARISON
============================================================

📌 DEFEATBETA API:
   Type: DataFrame
   Columns: ['symbol', 'report_date', 'open', 'close', 'high', 'low', 'volume']

   Latest 3 rows:
symbol report_date open close high low volume
7887 AAPL 2026-04-06 256.51 258.86 262.16 256.46 29329900
7888 AAPL 2026-04-07 256.16 253.50 256.20 245.70 62148000
7889 AAPL 2026-04-08 258.45 258.90 259.75 256.53 41032800
7890 AAPL 2026-04-09 259.00 260.49 261.12 256.07 28121600
7891 AAPL 2026-04-10 259.98 260.48 262.19 259.02 31291500
7892 AAPL 2026-04-13 259.73 259.20 260.18 256.66 36234700
7893 AAPL 2026-04-14 259.25 258.83 261.93 257.19 48370700
7894 AAPL 2026-04-15 258.16 266.43 266.56 257.81 49913500
7895 AAPL 2026-04-16 266.80 263.40 267.16 261.27 43323100
7896 AAPL 2026-04-17 266.96 270.23 272.30 266.72 61314800
📌 YAHOO FINANCE:
   Type: DataFrame
   Columns: ['Open', 'High', 'Low', 'Close', 'Volume', 'Dividends', 'Stock Splits']

   Latest 3 rows:
Open High Low Close Volume Dividends Stock Splits
Date
2026-04-13 00:00:00-04:00 259.730011 260.179993 256.660004 259.200012 36234700 0.0 0.0
2026-04-14 00:00:00-04:00 259.250000 261.929993 257.190002 258.829987 48370700 0.0 0.0
2026-04-15 00:00:00-04:00 258.160004 266.559998 257.809998 266.429993 49913500 0.0 0.0
2026-04-16 00:00:00-04:00 266.799988 267.160004 261.269989 263.399994 43323100 0.0 0.0
2026-04-17 00:00:00-04:00 266.959991 272.299988 266.720001 270.230011 61436200 0.0 0.0
2026-04-20 00:00:00-04:00 270.329987 274.279999 270.290009 273.049988 36590200 0.0 0.0
2026-04-21 00:00:00-04:00 271.500000 272.799988 265.399994 266.170013 50209800 0.0 0.0
2026-04-22 00:00:00-04:00 267.820007 273.739990 266.869995 273.170013 43249200 0.0 0.0
2026-04-23 00:00:00-04:00 275.049988 275.769989 271.649994 273.429993 33399600 0.0 0.0
2026-04-24 00:00:00-04:00 272.760010 273.059998 269.649994 271.059998 38124500 0.0 0.0

💰 3. VALUATION METRICS

In [7]:
# Explore valuation metrics - DefeatBeta provides HISTORICAL data
symbol = 'NVDA'  # NVIDIA for interesting metrics
db_ticker = Ticker(symbol)

print("=" * 60)
print("VALUATION METRICS (with historical data!)")
print("=" * 60)

print("\n📌 TTM EPS History:")
ttm_eps = db_ticker.ttm_eps()
display(ttm_eps.tail(5))

print("\n📌 TTM P/E Ratio History:")
ttm_pe = db_ticker.ttm_pe()
display(ttm_pe.tail(5))

print("\n📌 Market Capitalization History:")
market_cap = db_ticker.market_capitalization()
display(market_cap[['report_date', 'close_price', 'shares_outstanding', 'market_capitalization']].tail(5))
============================================================
VALUATION METRICS (with historical data!)
============================================================

📌 TTM EPS History:
symbol report_date tailing_eps eps update_time
104 NVDA 2025-01-31 2.94 0.89 2026-04-18
105 NVDA 2025-04-30 3.10 0.76 2026-04-18
106 NVDA 2025-07-31 3.51 1.08 2026-04-18
107 NVDA 2025-10-31 4.04 1.30 2026-04-18
108 NVDA 2026-01-31 4.90 1.76 2026-04-18
📌 TTM P/E Ratio History:
symbol report_date eps_report_date close_price ttm_eps ttm_pe
6846 NVDA 2026-04-13 2026-01-31 189.31 4.9 38.63
6847 NVDA 2026-04-14 2026-01-31 196.51 4.9 40.10
6848 NVDA 2026-04-15 2026-01-31 198.87 4.9 40.59
6849 NVDA 2026-04-16 2026-01-31 198.35 4.9 40.48
6850 NVDA 2026-04-17 2026-01-31 201.68 4.9 41.16
📌 Market Capitalization History:
report_date close_price shares_outstanding market_capitalization
6846 2026-04-13 189.31 2.430000e+10 4.600233e+12
6847 2026-04-14 196.51 2.430000e+10 4.775193e+12
6848 2026-04-15 198.87 2.430000e+10 4.832541e+12
6849 2026-04-16 198.35 2.430000e+10 4.819905e+12
6850 2026-04-17 201.68 2.430000e+10 4.900824e+12
In [8]:
# Compare with Yahoo Finance current values
if YFINANCE_AVAILABLE:
    print("\n" + "=" * 60)
    print("YAHOO FINANCE: Current Valuation (from .info)")
    print("=" * 60)
    
    yf_ticker = yf.Ticker(symbol)
    info = yf_ticker.info
    
    valuation_keys = ['trailingPE', 'forwardPE', 'marketCap', 'trailingEps', 'forwardEps']
    for key in valuation_keys:
        if key in info:
            print(f"   {key}: {info[key]}")
============================================================
YAHOO FINANCE: Current Valuation (from .info)
============================================================
   trailingPE: 42.591003
   forwardPE: 18.530712
   marketCap: 5062002737152
   trailingEps: 4.89
   forwardEps: 11.23918

📉 4. FINANCIAL STATEMENTS

In [9]:
# Explore quarterly income statement
symbol = 'MSFT'
db_ticker = Ticker(symbol)

print("=" * 60)
print("QUARTERLY INCOME STATEMENT")
print("=" * 60)

# Get the Statement object
income_stmt = db_ticker.quarterly_income_statement()
print(f"\n📌 Type: {type(income_stmt).__name__}")
print(f"   Methods: .df(), .data(), .print_pretty_table()")

# Get as DataFrame
stmt_df = income_stmt.df()
print(f"\n📌 DataFrame Shape: {stmt_df.shape}")
print(f"   Columns: TTM + 16 quarters")

# Show key metrics
key_metrics = [
    'Total Revenue',
    'Gross Profit',
    'Operating Income',
    'Net Income Common Stockholders',
    'Diluted EPS'
]

print("\n📌 KEY METRICS (TTM values):")
for metric in key_metrics:
    if metric in stmt_df['Breakdown'].values:
        row = stmt_df[stmt_df['Breakdown'] == metric].iloc[0]
        value = float(row['TTM'])  # Convert Decimal to float
        if abs(value) >= 1e9:
            print(f"   {metric}: ${value/1e9:.2f}B")
        elif abs(value) >= 1e6:
            print(f"   {metric}: ${value/1e6:.2f}M")
        else:
            print(f"   {metric}: ${value:.2f}")
============================================================
QUARTERLY INCOME STATEMENT
============================================================

📌 Type: Statement
   Methods: .df(), .data(), .print_pretty_table()

📌 DataFrame Shape: (47, 17)
   Columns: TTM + 16 quarters

📌 KEY METRICS (TTM values):
   Total Revenue: $281.72B
   Gross Profit: $193.89B
   Operating Income: $128.53B
   Net Income Common Stockholders: $101.83B
   Diluted EPS: $10.32
In [10]:
# Try the pretty print version
print("\n📌 FORMATTED TABLE (first 10 line items):")
print("-" * 60)
# Note: print_pretty_table() might be very wide, so let's show a subset
subset = stmt_df.head(10)[['Breakdown', 'TTM']]
subset.columns = ['Metric', 'TTM Value']
display(subset)
📌 FORMATTED TABLE (first 10 line items):
------------------------------------------------------------
Metric TTM Value
0 Total Revenue 281724000000.0
1 Operating Revenue 281724000000.0
2 Cost of Revenue 87831000000.0
3 Gross Profit 193893000000.0
4 Operating Expense 65365000000.0
5 Selling General and Administrative 32877000000.0
6 General & Administrative Expense 7223000000.0
7 Other G and A 7223000000.0
8 Selling & Marketing Expense 25654000000.0
9 Research & Development 32488000000.0

📈 5. FINANCIAL RATIOS

In [8]:
# Explore financial ratios with historical data
symbol = 'TSLA'  # Tesla for interesting ratios
db_ticker = Ticker(symbol)

print("=" * 60)
print("FINANCIAL RATIOS (Historical Time Series)")
print("=" * 60)

print("\n📌 RETURN ON EQUITY (ROE):")
roe = db_ticker.roe()
display(roe)

print("\n📌 RETURN ON INVESTED CAPITAL (ROIC):")
roic = db_ticker.roic()
display(roic)
============================================================
FINANCIAL RATIOS (Historical Time Series)
============================================================

📌 RETURN ON EQUITY (ROE):
symbol report_date net_income_common_stockholders beginning_stockholders_equity ending_stockholders_equity avg_equity roe
0 TSLA 2023-09-30 1.851000e+09 5.113000e+10 5.346600e+10 5.229800e+10 0.0354
1 TSLA 2023-12-31 7.927000e+09 5.346600e+10 6.263400e+10 5.805000e+10 0.1366
2 TSLA 2024-03-31 1.432000e+09 6.263400e+10 6.437800e+10 6.350600e+10 0.0225
3 TSLA 2024-06-30 1.400000e+09 6.437800e+10 6.646800e+10 6.542300e+10 0.0214
4 TSLA 2024-09-30 2.173000e+09 6.646800e+10 6.993100e+10 6.819950e+10 0.0319
5 TSLA 2024-12-31 2.314000e+09 6.993100e+10 7.291300e+10 7.142200e+10 0.0324
6 TSLA 2025-03-31 4.090000e+08 7.291300e+10 7.465300e+10 7.378300e+10 0.0055
7 TSLA 2025-06-30 1.172000e+09 7.465300e+10 7.731400e+10 7.598350e+10 0.0154
8 TSLA 2025-09-30 1.373000e+09 7.731400e+10 7.997000e+10 7.864200e+10 0.0175
9 TSLA 2025-12-31 8.400000e+08 7.997000e+10 8.213700e+10 8.105350e+10 0.0104
📌 RETURN ON INVESTED CAPITAL (ROIC):
symbol report_date ebit tax_rate_for_calcs nopat beginning_invested_capital ending_invested_capital avg_invested_capital roic
0 TSLA 2022-09-30 NaN NaN NaN 3.952800e+10 NaN NaN NaN
1 TSLA 2023-09-30 2.083000e+09 0.08 1.916360e+09 5.264900e+10 5.717000e+10 5.490950e+10 0.0349
2 TSLA 2023-12-31 2.252000e+09 0.21 1.779080e+09 5.717000e+10 6.729100e+10 6.223050e+10 0.0286
3 TSLA 2024-03-31 1.964000e+09 0.26 1.453360e+09 6.729100e+10 6.925200e+10 6.827150e+10 0.0213
4 TSLA 2024-06-30 1.873000e+09 0.21 1.479670e+09 6.925200e+10 7.383000e+10 7.154100e+10 0.0207
5 TSLA 2024-09-30 2.883000e+09 0.22 2.248740e+09 7.383000e+10 7.732100e+10 7.557550e+10 0.0298
6 TSLA 2024-12-31 2.862000e+09 0.16 2.404080e+09 7.732100e+10 8.079100e+10 7.905600e+10 0.0304
7 TSLA 2025-03-31 6.800000e+08 0.29 4.828000e+08 8.079100e+10 8.189700e+10 8.134400e+10 0.0059
8 TSLA 2025-06-30 1.635000e+09 0.23 1.258950e+09 8.189700e+10 8.427000e+10 8.308350e+10 0.0152
9 TSLA 2025-09-30 2.035000e+09 0.29 1.444850e+09 8.427000e+10 8.743100e+10 8.585050e+10 0.0168
10 TSLA 2025-12-31 1.266000e+09 0.28 9.115200e+08 8.743100e+10 9.029000e+10 8.886050e+10 0.0103
In [21]:
# WACC - Weighted Average Cost of Capital
print("\n📌 WEIGHTED AVERAGE COST OF CAPITAL (WACC):")
wacc = db_ticker.wacc()
print(f"   Columns: {list(wacc.columns)}")
print(f"\n   Latest calculation components:")
latest_wacc = wacc.iloc[-1]
print(f"   Market Cap: ${float(latest_wacc['market_capitalization'])/1e9:.2f}B")
print(f"   Beta (5Y): {float(latest_wacc['beta_5y']):.4f}")
print(f"   S&P 500 10Y CAGR: {float(latest_wacc['sp500_10y_cagr']):.2%}")
print(f"   Treasury 10Y Yield: {float(latest_wacc['treasure_10y_yield']):.2%}")
print(f"   Weight of Debt: {float(latest_wacc['weight_of_debt']):.4f}")
print(f"   Weight of Equity: {float(latest_wacc['weight_of_equity']):.4f}")
print(f"   Cost of Debt: {float(latest_wacc['cost_of_debt']):.4f}")
print(f"   Cost of Equity: {float(latest_wacc['cost_of_equity']):.4f}")
print(f"\n   ⭐ WACC: {float(latest_wacc['wacc']):.4f} ({float(latest_wacc['wacc']):.2%}")
📌 WEIGHTED AVERAGE COST OF CAPITAL (WACC):
   Columns: ['symbol', 'report_date', 'market_capitalization', 'exchange_rate', 'total_debt', 'total_debt_usd', 'interest_expense', 'interest_expense_usd', 'pretax_income', 'pretax_income_usd', 'tax_provision', 'tax_provision_usd', 'tax_rate_for_calcs', 'sp500_cagr_end', 'sp500_10y_cagr', 'treasure_10y_yield', 'beta_5y', 'weight_of_debt', 'weight_of_equity', 'cost_of_debt', 'cost_of_equity', 'wacc']

   Latest calculation components:
   Market Cap: $3967.28B
   Beta (5Y): 1.0636
   S&P 500 10Y CAGR: 12.87%
   Treasury 10Y Yield: 4.26%
   Weight of Debt: 0.0272
   Weight of Equity: 0.9728
   Cost of Debt: 0.0090
   Cost of Equity: 0.1342

   ⭐ WACC: 0.1308 (13.08%

📊 6. GROWTH & MARGIN METRICS

In [10]:
# Explore growth metrics
symbol = 'NVDA'
db_ticker = Ticker(symbol)

print("=" * 60)
print("GROWTH & MARGIN METRICS")
print("=" * 60)

print("\n📌 QUARTERLY REVENUE YoY GROWTH:")
rev_growth = db_ticker.quarterly_revenue_yoy_growth()
display(rev_growth.tail(8))

print("\n📌 QUARTERLY EPS YoY GROWTH:")
eps_growth = db_ticker.quarterly_eps_yoy_growth()
display(eps_growth.tail(8))
============================================================
GROWTH & MARGIN METRICS
============================================================

📌 QUARTERLY REVENUE YoY GROWTH:
symbol report_date revenue prev_year_revenue yoy_growth
5 NVDA 2024-04-30 2.604400e+10 NaN NaN
6 NVDA 2024-07-31 3.004000e+10 1.350700e+10 1.2240
7 NVDA 2024-10-31 3.508200e+10 1.812000e+10 0.9361
8 NVDA 2025-01-31 3.933100e+10 2.210300e+10 0.7794
9 NVDA 2025-04-30 4.406200e+10 2.604400e+10 0.6918
10 NVDA 2025-07-31 4.674300e+10 3.004000e+10 0.5560
11 NVDA 2025-10-31 5.700600e+10 3.508200e+10 0.6249
12 NVDA 2026-01-31 6.812700e+10 3.933100e+10 0.7321
📌 QUARTERLY EPS YoY GROWTH:
symbol report_date eps prev_year_eps yoy_growth
101 NVDA 2024-04-30 0.60 0.08 6.5000
102 NVDA 2024-07-31 0.67 0.25 1.6800
103 NVDA 2024-10-31 0.78 0.37 1.1081
104 NVDA 2025-01-31 0.89 0.49 0.8163
105 NVDA 2025-04-30 0.76 0.60 0.2667
106 NVDA 2025-07-31 1.08 0.67 0.6119
107 NVDA 2025-10-31 1.30 0.78 0.6667
108 NVDA 2026-01-31 1.76 0.89 0.9775
In [11]:
# Margin metrics
print("\n📌 QUARTERLY GROSS MARGIN:")
gross_margin = db_ticker.quarterly_gross_margin()
display(gross_margin.tail(5))

print("\n📌 QUARTERLY NET MARGIN:")
net_margin = db_ticker.quarterly_net_margin()
display(net_margin.tail(5))
📌 QUARTERLY GROSS MARGIN:
symbol report_date gross_profit total_revenue gross_margin
11 NVDA 2025-01-31 2.872300e+10 3.933100e+10 0.7303
12 NVDA 2025-04-30 2.666800e+10 4.406200e+10 0.6052
13 NVDA 2025-07-31 3.385300e+10 4.674300e+10 0.7242
14 NVDA 2025-10-31 4.184900e+10 5.700600e+10 0.7341
15 NVDA 2026-01-31 5.109300e+10 6.812700e+10 0.7500
📌 QUARTERLY NET MARGIN:
symbol report_date net_income_common_stockholders total_revenue net_margin
11 NVDA 2025-01-31 2.209100e+10 3.933100e+10 0.5617
12 NVDA 2025-04-30 1.877500e+10 4.406200e+10 0.4261
13 NVDA 2025-07-31 2.642200e+10 4.674300e+10 0.5653
14 NVDA 2025-10-31 3.191000e+10 5.700600e+10 0.5598
15 NVDA 2026-01-31 4.296000e+10 6.812700e+10 0.6306

🎯 7. UNIQUE FEATURES: EARNINGS TRANSCRIPTS

In [12]:
# Access earnings call transcripts
symbol = 'AAPL'
db_ticker = Ticker(symbol)

print("=" * 60)
print("EARNINGS CALL TRANSCRIPTS (Unique to DefeatBeta!)")
print("=" * 60)

transcripts = db_ticker.earning_call_transcripts()
transcript_list = transcripts.get_transcripts_list()

print(f"\n📌 Available transcripts: {len(transcript_list)} quarters")
print(f"   From FY{transcript_list.iloc[0]['fiscal_year']} Q{transcript_list.iloc[0]['fiscal_quarter']} to FY{transcript_list.iloc[-1]['fiscal_year']} Q{transcript_list.iloc[-1]['fiscal_quarter']}")

print("\n📌 MOST RECENT TRANSCRIPTS:")
display(transcript_list[['fiscal_year', 'fiscal_quarter', 'report_date']].tail(5))
============================================================
EARNINGS CALL TRANSCRIPTS (Unique to DefeatBeta!)
============================================================

📌 Available transcripts: 82 quarters
   From FY2005 Q4 to FY2026 Q1

📌 MOST RECENT TRANSCRIPTS:
fiscal_year fiscal_quarter report_date
77 2025 1 2025-01-30
78 2025 2 2025-05-01
79 2025 3 2025-07-31
80 2025 4 2025-10-30
81 2026 1 2026-01-29
In [13]:
# Get a specific transcript
print("\n📌 SAMPLE: Q4 2025 EARNINGS CALL")
q4_2025 = transcripts.get_transcript(2025, 4)

if q4_2025 is not None and len(q4_2025) > 0:
    print(f"   Type: {type(q4_2025).__name__}")
    print(f"   Total paragraphs: {len(q4_2025)}")
    print(f"   Speakers: {q4_2025['speaker'].nunique()}")
    
    print("\n   📝 FIRST 3 PARAGRAPHS:")
    for idx, row in q4_2025.head(3).iterrows():
        speaker = row['speaker']
        content = row['content'][:150] + "..." if len(row['content']) > 150 else row['content']
        print(f"\n   [{speaker}]:")
        print(f"   {content}")
📌 SAMPLE: Q4 2025 EARNINGS CALL
   Type: DataFrame
   Total paragraphs: 77
   Speakers: 15

   📝 FIRST 3 PARAGRAPHS:

   [Suhasini Chandramouli]:
   Good afternoon, and welcome to the Apple Q4 Fiscal Year 2025 Earnings Conference Call. My name is Suhasini Chandramouli, Director of Investor Relation...

   [Timothy Cook]:
   Thank you, Suhasini. Good afternoon, everyone, and thanks for joining the call. Today, Apple is proud to report $102.5 billion in revenue, up 8% from ...

   [Kevan Parekh]:
   Thanks, Tim, and good afternoon, everyone. Our revenue of $102.5 billion was up 8% year-over-year and is a new September quarter record. We set some t...
In [14]:
# AI-powered analysis (requires OpenAI API key)
print("\n📌 AVAILABLE AI METHODS:")
ai_methods = [m for m in dir(transcripts) if 'ai' in m.lower() or 'analyze' in m.lower()]
for method in ai_methods:
    print(f"   • transcripts.{method}()")

print("\n⚠️  NOTE: AI methods require OPENAI_API_KEY to be set in environment")
print("    Set with: export OPENAI_API_KEY=your_key_here")
📌 AVAILABLE AI METHODS:
   • transcripts.analyze_financial_metrics_change_for_this_quarter_with_ai()
   • transcripts.analyze_financial_metrics_forecast_for_future_with_ai()
   • transcripts.summarize_key_financial_data_with_ai()

⚠️  NOTE: AI methods require OPENAI_API_KEY to be set in environment
    Set with: export OPENAI_API_KEY=your_key_here

🌍 8. REVENUE BREAKDOWN (Unique Feature!)

In [15]:
# Revenue by segment - unique to DefeatBeta!
symbol = 'AAPL'
db_ticker = Ticker(symbol)

print("=" * 60)
print("REVENUE BREAKDOWN BY SEGMENT")
print("=" * 60)

revenue_segment = db_ticker.revenue_by_segment()
print(f"\n📌 Columns: {list(revenue_segment.columns)}")
print(f"\n📌 Latest Quarter ({revenue_segment.iloc[-1]['report_date']}):")

latest = revenue_segment.iloc[-1]
total = 0
for col in revenue_segment.columns[2:]:  # Skip symbol and report_date
    value = latest[col]
    if pd.notna(value):
        value = float(value)  # Convert Decimal to float
        print(f"   {col}: ${value/1e9:.2f}B")
        total += value
print(f"\n   TOTAL: ${total/1e9:.2f}B")
============================================================
REVENUE BREAKDOWN BY SEGMENT
============================================================

📌 Columns: ['symbol', 'report_date', 'Mac', 'Services', 'Wearables, Home and Accessories', 'iPad', 'iPhone']

📌 Latest Quarter (2025-12-31):
   Mac: $8.39B
   Services: $30.01B
   Wearables, Home and Accessories: $11.49B
   iPad: $8.60B
   iPhone: $85.27B

   TOTAL: $143.76B
In [16]:
# Revenue by geography
print("\n📌 REVENUE BY GEOGRAPHY:")
revenue_geo = db_ticker.revenue_by_geography()
display(revenue_geo.tail(3))
📌 REVENUE BY GEOGRAPHY:
symbol report_date Americas Europe Greater China Japan Rest of Asia Pacific
20 AAPL 2025-06-30 4.119800e+10 2.401400e+10 1.536900e+10 5.782000e+09 7.673000e+09
21 AAPL 2025-09-30 4.419200e+10 2.870300e+10 1.449300e+10 6.636000e+09 8.442000e+09
22 AAPL 2025-12-31 5.852900e+10 3.814600e+10 2.552600e+10 9.413000e+09 1.214200e+10

📋 9. DCF VALUATION (Automated!)

In [17]:
# Automated DCF Valuation
symbol = 'AAPL'
db_ticker = Ticker(symbol)

print("=" * 60)
print("AUTOMATED DCF VALUATION")
print("=" * 60)

print("\n📌 Running DCF analysis...")
dcf_result = db_ticker.dcf()

print(f"\n   Return type: {type(dcf_result).__name__}")
if isinstance(dcf_result, dict):
    print(f"   Keys: {list(dcf_result.keys())}")
    print(f"   Description: {dcf_result.get('description', 'N/A')}")
    if 'file_path' in dcf_result:
        print(f"   Excel file: {dcf_result['file_path']}")

print("\n⚠️  NOTE: DCF generates a professional Excel spreadsheet with:")
print("   • WACC calculations")
print("   • 10-year cash flow projections")
print("   • Enterprise value and fair price")
print("   • Buy/Sell recommendations")
============================================================
AUTOMATED DCF VALUATION
============================================================

📌 Running DCF analysis...
   Return type: dict
   Keys: ['file_path', 'description']
   Description: DCF Valuation Analysis for AAPL
   Excel file: AAPL.xlsx

⚠️  NOTE: DCF generates a professional Excel spreadsheet with:
   • WACC calculations
   • 10-year cash flow projections
   • Enterprise value and fair price
   • Buy/Sell recommendations

🔍 10. EXPLORE YOUR OWN STOCK

In [18]:
# Interactive stock analysis - change the symbol!
SYMBOL = 'GOOGL'  # ⬅️ CHANGE THIS TO ANY STOCK SYMBOL

print("=" * 60)
print(f"EXPLORING: {SYMBOL}")
print("=" * 60)

ticker = Ticker(SYMBOL)

# Basic stats
price_data = ticker.price()
latest = price_data.iloc[-1]

print(f"\n📌 CURRENT PRICE DATA:")
print(f"   Latest Close: ${float(latest['close']):.2f}")
print(f"   Date: {latest['report_date']}")
print(f"   Volume: {int(latest['volume']):,}")

# Valuation
ttm_pe = ticker.ttm_pe()
if not ttm_pe.empty:
    print(f"\n📌 VALUATION:")
    print(f"   TTM P/E: {float(ttm_pe.iloc[-1]['ttm_pe']):.2f}")

market_cap = ticker.market_capitalization()
if not market_cap.empty:
    mcap = float(market_cap.iloc[-1]['market_capitalization'])
    print(f"   Market Cap: ${mcap/1e9:.2f}B")

# Ratios
roe = ticker.roe()
if not roe.empty:
    print(f"\n📌 PROFITABILITY:")
    print(f"   ROE: {float(roe.iloc[-1]['roe']):.2%}")

wacc = ticker.wacc()
if not wacc.empty:
    print(f"   WACC: {float(wacc.iloc[-1]['wacc']):.2%}")

# Growth
growth = ticker.quarterly_revenue_yoy_growth()
if not growth.empty:
    print(f"\n📌 GROWTH:")
    print(f"   Revenue YoY Growth: {float(growth.iloc[-1]['yoy_growth']):.2%}")
============================================================
EXPLORING: GOOGL
============================================================

📌 CURRENT PRICE DATA:
   Latest Close: $341.68
   Date: 2026-04-17
   Volume: 25,519,000

📌 VALUATION:
   TTM P/E: 31.61
   Market Cap: $4133.30B

📌 PROFITABILITY:
   ROE: 8.59%
   WACC: 13.93%

📌 GROWTH:
   Revenue YoY Growth: 18.00%

🧪 11. STOCK COMPARISON

In [19]:
# Compare multiple stocks
stocks = ['AAPL', 'MSFT', 'GOOGL', 'NVDA']  # ⬅️ CHANGE THESE

print("=" * 60)
print("STOCK COMPARISON")
print("=" * 60)

comparison_data = []

for symbol in stocks:
    try:
        ticker = Ticker(symbol)
        
        metrics = {'Symbol': symbol}
        
        # Price
        price = ticker.price()
        if not price.empty:
            metrics['Price'] = float(price.iloc[-1]['close'])
        
        # Valuation
        ttm_pe = ticker.ttm_pe()
        if not ttm_pe.empty:
            metrics['P/E'] = float(ttm_pe.iloc[-1]['ttm_pe'])
        
        market_cap = ticker.market_capitalization()
        if not market_cap.empty:
            metrics['Market Cap'] = float(market_cap.iloc[-1]['market_capitalization'])
        
        # Profitability
        roe = ticker.roe()
        if not roe.empty:
            metrics['ROE'] = float(roe.iloc[-1]['roe'])
        
        # Growth
        growth = ticker.quarterly_revenue_yoy_growth()
        if not growth.empty:
            metrics['Rev Growth'] = float(growth.iloc[-1]['yoy_growth'])
        
        # Margins
        gross_margin = ticker.quarterly_gross_margin()
        if not gross_margin.empty:
            metrics['Gross Margin'] = float(gross_margin.iloc[-1]['gross_margin'])
        
        comparison_data.append(metrics)
        
    except Exception as e:
        print(f"⚠️  Error loading {symbol}: {e}")

df = pd.DataFrame(comparison_data)
df.set_index('Symbol', inplace=True)

# Format Market Cap in billions
df['Market Cap'] = df['Market Cap'].apply(lambda x: f"${x/1e9:.1f}B" if pd.notna(x) else 'N/A')
df['Rev Growth'] = df['Rev Growth'].apply(lambda x: f"{x:.1%}" if pd.notna(x) else 'N/A')
df['Gross Margin'] = df['Gross Margin'].apply(lambda x: f"{x:.1%}" if pd.notna(x) else 'N/A')
df['ROE'] = df['ROE'].apply(lambda x: f"{x:.1%}" if pd.notna(x) else 'N/A')

print("\n📌 COMPARISON TABLE:")
display(df)
============================================================
STOCK COMPARISON
============================================================

📌 COMPARISON TABLE:
Price P/E Market Cap ROE Rev Growth Gross Margin
Symbol
AAPL 270.23 34.21 $3967.3B 52.0% 15.7% 48.2%
MSFT 422.79 26.46 $3139.5B 10.2% 16.7% 68.0%
GOOGL 341.68 31.61 $4133.3B 8.6% 18.0% 59.8%
NVDA 201.68 41.16 $4900.8B 31.1% 73.2% 75.0%

📚 12. COMPLETE METHOD REFERENCE

In [20]:
# List all available methods
symbol = 'AAPL'
ticker = Ticker(symbol)

print("=" * 60)
print("COMPLETE API METHOD REFERENCE")
print("=" * 60)

all_methods = [m for m in dir(ticker) if not m.startswith('_')]

categories = {
    '💹 Price & Volume': ['price'],
    '📊 Valuation': ['ttm_eps', 'ttm_pe', 'market_capitalization', 'ps_ratio', 'pb_ratio', 'peg_ratio'],
    '📈 Financial Ratios': ['roe', 'roic', 'roa', 'wacc', 'beta', 'equity_multiplier', 'asset_turnover'],
    '📋 Income Statement': ['quarterly_income_statement', 'annual_income_statement'],
    '⚖️ Balance Sheet': ['quarterly_balance_sheet', 'annual_balance_sheet'],
    '💵 Cash Flow': ['quarterly_cash_flow', 'annual_cash_flow'],
    '📉 Growth Metrics': [m for m in all_methods if 'yoy_growth' in m.lower()],
    '📊 Margin Metrics': [m for m in all_methods if 'margin' in m.lower() and 'industry' not in m.lower()],
    '🎙️ Special Data': ['earning_call_transcripts', 'news', 'sec_filing', 'dividends', 'splits'],
    '🌍 Revenue Breakdown': ['revenue_by_segment', 'revenue_by_product', 'revenue_by_geography'],
    '🏭 Industry Metrics': [m for m in all_methods if 'industry' in m.lower()],
    'ℹ️ Info & Calendar': ['info', 'calendar', 'currency', 'shares', 'officers']
}

for category, methods in categories.items():
    matching = [m for m in methods if m in all_methods]
    if matching:
        print(f"\n{category}:")
        for method in sorted(matching):
            print(f"   • ticker.{method}()")
============================================================
COMPLETE API METHOD REFERENCE
============================================================

💹 Price & Volume:
   • ticker.price()

📊 Valuation:
   • ticker.market_capitalization()
   • ticker.pb_ratio()
   • ticker.peg_ratio()
   • ticker.ps_ratio()
   • ticker.ttm_eps()
   • ticker.ttm_pe()

📈 Financial Ratios:
   • ticker.asset_turnover()
   • ticker.beta()
   • ticker.equity_multiplier()
   • ticker.roa()
   • ticker.roe()
   • ticker.roic()
   • ticker.wacc()

📋 Income Statement:
   • ticker.annual_income_statement()
   • ticker.quarterly_income_statement()

⚖️ Balance Sheet:
   • ticker.annual_balance_sheet()
   • ticker.quarterly_balance_sheet()

💵 Cash Flow:
   • ticker.annual_cash_flow()
   • ticker.quarterly_cash_flow()

📉 Growth Metrics:
   • ticker.annual_ebitda_yoy_growth()
   • ticker.annual_fcf_yoy_growth()
   • ticker.annual_net_income_yoy_growth()
   • ticker.annual_operating_income_yoy_growth()
   • ticker.annual_revenue_yoy_growth()
   • ticker.quarterly_ebitda_yoy_growth()
   • ticker.quarterly_eps_yoy_growth()
   • ticker.quarterly_fcf_yoy_growth()
   • ticker.quarterly_net_income_yoy_growth()
   • ticker.quarterly_operating_income_yoy_growth()
   • ticker.quarterly_revenue_yoy_growth()
   • ticker.quarterly_ttm_eps_yoy_growth()

📊 Margin Metrics:
   • ticker.annual_ebitda_margin()
   • ticker.annual_fcf_margin()
   • ticker.annual_gross_margin()
   • ticker.annual_net_margin()
   • ticker.annual_operating_margin()
   • ticker.quarterly_ebitda_margin()
   • ticker.quarterly_fcf_margin()
   • ticker.quarterly_gross_margin()
   • ticker.quarterly_net_margin()
   • ticker.quarterly_operating_margin()

🎙️ Special Data:
   • ticker.dividends()
   • ticker.earning_call_transcripts()
   • ticker.news()
   • ticker.sec_filing()
   • ticker.splits()

🌍 Revenue Breakdown:
   • ticker.revenue_by_geography()
   • ticker.revenue_by_product()
   • ticker.revenue_by_segment()

🏭 Industry Metrics:
   • ticker.industry_asset_turnover()
   • ticker.industry_equity_multiplier()
   • ticker.industry_pb_ratio()
   • ticker.industry_ps_ratio()
   • ticker.industry_quarterly_ebitda_margin()
   • ticker.industry_quarterly_gross_margin()
   • ticker.industry_quarterly_net_margin()
   • ticker.industry_roa()
   • ticker.industry_roe()
   • ticker.industry_ttm_pe()

ℹ️ Info & Calendar:
   • ticker.calendar()
   • ticker.currency()
   • ticker.info()
   • ticker.officers()
   • ticker.shares()

🎓 EXERCISES TO TRY

Exercise 1: Find Undervalued Stocks

Screen for stocks with P/E < 20 but ROE > 15%

Exercise 2: Growth Stock Analysis

Compare NVDA vs AMD on revenue growth, margins, and profitability

Exercise 3: DCF Valuation

Run DCF on 3 different stocks and compare their fair value estimates

Exercise 4: Revenue Mix Analysis

Analyze how Apple's revenue mix has shifted from hardware to services

Exercise 5: Earnings Transcript Mining

Extract key topics and sentiment from recent earnings calls


📖 SUMMARY

DefeatBeta-API vs Yahoo Finance

Feature DefeatBeta Yahoo Finance
Rate Limits None Yes
Historical Data Full Full
Financial Ratios Time series ⚠️ Current only
Earnings Transcripts Yes No
Revenue Segmentation Yes No
DCF Valuation Automated No
Real-time Data Daily batch 15min delayed
Query Speed Fast (DuckDB) 🐢 Variable

When to Use Each

  • DefeatBeta: Historical analysis, financial modeling, backtesting, DCF
  • Yahoo Finance: Real-time data, analyst consensus, quick lookups
In [22]:
sym = "AAPL"
dbt = Ticker(sym)
In [32]:
dir(dbt)
Out [32]:
['__class__',
 '__delattr__',
 '__dict__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__getstate__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 '_add_dcf_template_section',
 '_add_dcf_value_section',
 '_add_discount_rate_section',
 '_add_growth_estimates_section',
 '_add_key_metrics_display',
 '_calculate_yoy_growth',
 '_dataframe_to_stock_statements',
 '_generate_margin',
 '_get_finance_values_map',
 '_quarterly_book_value_of_equity',
 '_quarterly_eps_yoy_growth',
 '_query_data',
 '_query_data2',
 '_revenue_by_breakdown',
 '_statement',
 'annual_balance_sheet',
 'annual_cash_flow',
 'annual_ebitda_margin',
 'annual_ebitda_yoy_growth',
 'annual_fcf_margin',
 'annual_fcf_yoy_growth',
 'annual_gross_margin',
 'annual_income_statement',
 'annual_net_income_yoy_growth',
 'annual_net_margin',
 'annual_operating_income_yoy_growth',
 'annual_operating_margin',
 'annual_revenue_yoy_growth',
 'asset_turnover',
 'beta',
 'calendar',
 'company_meta',
 'config',
 'currency',
 'dcf',
 'dividends',
 'download_data_performance',
 'duckdb_client',
 'earning_call_transcripts',
 'equity_multiplier',
 'http_proxy',
 'huggingface_client',
 'industry_asset_turnover',
 'industry_equity_multiplier',
 'industry_pb_ratio',
 'industry_ps_ratio',
 'industry_quarterly_ebitda_margin',
 'industry_quarterly_gross_margin',
 'industry_quarterly_net_margin',
 'industry_roa',
 'industry_roe',
 'industry_ttm_pe',
 'info',
 'log_level',
 'market_capitalization',
 'news',
 'officers',
 'pb_ratio',
 'peg_ratio',
 'price',
 'ps_ratio',
 'quarterly_balance_sheet',
 'quarterly_cash_flow',
 'quarterly_ebitda_margin',
 'quarterly_ebitda_yoy_growth',
 'quarterly_eps_yoy_growth',
 'quarterly_fcf_margin',
 'quarterly_fcf_yoy_growth',
 'quarterly_gross_margin',
 'quarterly_income_statement',
 'quarterly_net_income_yoy_growth',
 'quarterly_net_margin',
 'quarterly_operating_income_yoy_growth',
 'quarterly_operating_margin',
 'quarterly_revenue_yoy_growth',
 'quarterly_ttm_eps_yoy_growth',
 'revenue_by_geography',
 'revenue_by_product',
 'revenue_by_segment',
 'roa',
 'roe',
 'roic',
 'sec_filing',
 'shares',
 'splits',
 'ticker',
 'treasure',
 'ttm_eps',
 'ttm_fcf',
 'ttm_net_income_common_stockholders',
 'ttm_pe',
 'ttm_revenue',
 'wacc']
In [33]:
dbt.info()
Out [33]:
symbol address city country phone zip industry sector long_business_summary full_time_employees web_site report_date
0 AAPL One Apple Park Way Cupertino United States (408) 996-1010 95014 Consumer Electronics Technology Apple Inc. designs, manufactures, and markets ... 150000 https://www.apple.com 2026-04-18
In [ ]:
dbt
In [29]:
yft = yf.ticker.Ticker(sym)
In [31]:
dir(yft)
Out [31]:
['__class__',
 '__delattr__',
 '__dict__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__getstate__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 '_analysis',
 '_data',
 '_download_options',
 '_earnings',
 '_earnings_dates',
 '_expirations',
 '_fast_info',
 '_fetch_ticker_tz',
 '_financials',
 '_fundamentals',
 '_funds_data',
 '_get_earnings_dates_using_scrape',
 '_get_earnings_dates_using_screener',
 '_get_ticker_tz',
 '_holders',
 '_isin',
 '_lazy_load_price_history',
 '_message_handler',
 '_news',
 '_options2df',
 '_price_history',
 '_quote',
 '_shares',
 '_tz',
 '_underlying',
 'actions',
 'analyst_price_targets',
 'balance_sheet',
 'balancesheet',
 'calendar',
 'capital_gains',
 'cash_flow',
 'cashflow',
 'dividends',
 'earnings',
 'earnings_dates',
 'earnings_estimate',
 'earnings_history',
 'eps_revisions',
 'eps_trend',
 'fast_info',
 'financials',
 'funds_data',
 'get_actions',
 'get_analyst_price_targets',
 'get_balance_sheet',
 'get_balancesheet',
 'get_calendar',
 'get_capital_gains',
 'get_cash_flow',
 'get_cashflow',
 'get_dividends',
 'get_earnings',
 'get_earnings_dates',
 'get_earnings_estimate',
 'get_earnings_history',
 'get_eps_revisions',
 'get_eps_trend',
 'get_fast_info',
 'get_financials',
 'get_funds_data',
 'get_growth_estimates',
 'get_history_metadata',
 'get_income_stmt',
 'get_incomestmt',
 'get_info',
 'get_insider_purchases',
 'get_insider_roster_holders',
 'get_insider_transactions',
 'get_institutional_holders',
 'get_isin',
 'get_major_holders',
 'get_mutualfund_holders',
 'get_news',
 'get_recommendations',
 'get_recommendations_summary',
 'get_revenue_estimate',
 'get_sec_filings',
 'get_shares',
 'get_shares_full',
 'get_splits',
 'get_sustainability',
 'get_upgrades_downgrades',
 'get_valuation_measures',
 'growth_estimates',
 'history',
 'history_metadata',
 'income_stmt',
 'incomestmt',
 'info',
 'insider_purchases',
 'insider_roster_holders',
 'insider_transactions',
 'institutional_holders',
 'isin',
 'live',
 'major_holders',
 'mutualfund_holders',
 'news',
 'option_chain',
 'options',
 'quarterly_balance_sheet',
 'quarterly_balancesheet',
 'quarterly_cash_flow',
 'quarterly_cashflow',
 'quarterly_earnings',
 'quarterly_financials',
 'quarterly_income_stmt',
 'quarterly_incomestmt',
 'recommendations',
 'recommendations_summary',
 'revenue_estimate',
 'sec_filings',
 'session',
 'shares',
 'splits',
 'sustainability',
 'ticker',
 'ttm_cash_flow',
 'ttm_cashflow',
 'ttm_financials',
 'ttm_income_stmt',
 'ttm_incomestmt',
 'upgrades_downgrades',
 'valuation',
 'ws']
In [20]:
import vectorbt as vbt
data = Ticker("AAPL")
price = data.price().close
In [21]:
fast_ma = vbt.MA.run(price, 10)
slow_ma = vbt.MA.run(price, 50)
In [26]:
entries = fast_ma.ma_crossed_above(slow_ma)
exits = slow_ma.ma_crossed_above(fast_ma)
In [27]:
pf = vbt.Portfolio.from_signals(price, entries, exits, init_cash=100)
In [30]:
pf.total_profit()
Out [30]:
np.float64(24134.667890761524)
In [37]:
df = data.price()
In [38]:
# Move the 'report_date' column into the Index position
df['report_date'] = pd.to_datetime(df['report_date'])
df = df.set_index('report_date')
In [ ]:
In [ ]:
In [54]:
import numpy as np

symbols = ["BTC-USD", "ETH-USD"]
data = vbt.YFData.download(symbols, missing_index="drop")
price = data.get("Close")

n = np.random.randint(10, 101, size=1000).tolist()
pf = vbt.Portfolio.from_random_signals(price, n=n, init_cash=100, seed=42)

mean_expectancy = pf.trades.expectancy().groupby(["randnx_n", "symbol"]).mean()
fig = mean_expectancy.unstack().vbt.scatterplot(xaxis_title="randnx_n", yaxis_title="mean_expectancy")
fig.show()
/home/df/scratch/trading/learn-trading/.venv/lib/python3.12/site-packages/vectorbt/data/base.py:535: UserWarning: Symbols have mismatching index. Dropping missing data points.
  data = cls.align_index(data, missing=missing_index)
In [63]:
from defeatbeta_api.data.company_meta import CompanyMeta

meta = CompanyMeta()
pd.DataFrame(meta.get_all_companies_info())
Out [63]:
idx symbol cik name financial_currency
0 0 NVDA 1045810.0 NVIDIA CORP USD
1 1 GOOGL 1652044.0 Alphabet Inc. USD
2 2 AAPL 320193.0 Apple Inc. USD
3 3 MSFT 789019.0 MICROSOFT CORP USD
4 4 AMZN 1018724.0 AMAZON COM INC USD
... ... ... ... ... ...
10396 extra_5 USMV NaN iShares MSCI USA Min Vol Factor ETF USD
10397 extra_6 IWM NaN iShares Russell 2000 ETF USD
10398 extra_7 VTV NaN Vanguard Value ETF USD
10399 extra_8 TLT NaN iShares 20+ Year Treasury Bond ETF USD
10400 extra_9 JNK NaN SPDR Bloomberg High Yield Bond ETF USD

10401 rows × 5 columns

In [64]:
dbt.
  Cell In[64], line 1
    dbt.
        ^
SyntaxError: invalid syntax
In [ ]: