๐Ÿ’ธ

Price to Earnings

๐Ÿ’ก
This is not investment advice, there is no implication of any guarantee. All investment is risky and you should take advice from actual advisors. EDUCATION ONLY.

Definition

Price to Earnings Ratio

The price-to-earnings ratio examines the market value of a share to its earnings. In other words, itโ€™s a simple ratio that compares what youโ€™re paying against its value. Like any number, this is an oversimplification that will be dependent on a thousand microfactors.

Formula

Price to Earnings Ratio

  • Market Value - The current price of one share of a company.
  • Earnings Per Share (EPS) - Net Profit / Common Shares - an indicator of the value of a share.

Python Code

Earnings Per Share

!pip install yfinance
import yfinance as yf

storage = []

def PE (ticker):
  stock = yf.Ticker("msft").info
  
  return [stock["trailingPE"],stock["forwardPE"]]

storage = PE('APPL')
print('AAPL: ', storage)

#AAPL:  [33.107895, 28.916279]