Price-to-earnings ratio
A price-to-earnings ratio compares a company’s or stock’s market price with its earnings per share.
Investing for Programmers
A price-to-earnings ratio is a valuation ratio comparing a company's share price with its earnings per share.
- How it is used
- Uses P/E to assess stock valuation while building investment vocabulary and comparing companies.
- How deep it goes
- Defines the formula, compares baselines, distinguishes trailing and forward values, and defers complete judgment to broader analysis.
- Examples
- Uses NVIDIA, Pfizer, Walmart, Apple, Sempra, and Coca-Cola comparisons plus sector medians and historical averages.
- What you can do after
- Evaluate relative valuation with P/E, PEG, sector benchmarks, peer comparisons, and historical context without treating one ratio as decisive.
Read how Investing for Programmers explains price-to-earnings ratio →
Build a Robo-Advisor with Python (From Scratch)
A valuation ratio comparing a stock's market price with its earnings per share.
- How it is used
- Uses valuation changes to adjust historical stock-return estimates.
- How deep it goes
- Defines standard P/E through its earnings input, contrasts CAPE, and applies the adjusted measure in a regression workflow.
- Examples
- Uses VFINX stock returns, CAPE percentage changes, and regression of excess returns on valuation changes.
- What you can do after
- Evaluate how changing equity valuations may affect historical-return estimates.
Read how Build a Robo-Advisor with Python (From Scratch) explains price-to-earnings ratio →
Related concepts
- cyclically adjusted price-to-earnings ratiocontrasts with · The cyclically adjusted price-to-earnings ratio is a valuation metric that divides an asset's price by its average inflation-adjusted earnings over the preceding ten years.
- price/earnings-to-growth ratioused by · A price/earnings-to-growth ratio compares a company’s price-to-earnings ratio with its earnings growth rate.
- earnings per sharemeasures · Earnings per share is a company’s net income attributable to common shareholders divided by its outstanding common shares.
- financial ratiokind of · A financial ratio is a quantitative relationship between financial statement values used to evaluate financial condition, performance, or valuation.
- stock share pricemeasures · A stock share price is the market value of one share of a publicly traded company or security at a particular time.
- price-to-sales ratiomeasures · A price-to-sales ratio compares a company’s market value with its sales or revenue.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

