-
치폴레(Chipotle/CMG) 미국 주가 분석 With FinancialModelingPrep & PythonData Analysis/Investment 2021. 4. 15. 16:42
미국 주식 데이터 API FinancialModelingPrep를 활용해서 내가 미국 식음료 브랜드 중 가장 좋아하는 치폴레에 대해 간략히 분석해보도록 하겠다.
1. 치폴레 주가
치폴레에 본격적으로 살펴보기 전에 간략히 치폴레 주가 현황을 알아보도록 하겠다.
미국 소비 시장을 이끄는 밀레니얼 세대가 가장 좋아하는 브랜드인 만큼 치폴레 주가도 상장 이후 계속해서 증가하는 추세를 이어나가고 있다. 코로나 이슈도 치폴레 상승세를 막을 수 없었다.
import FinanceDataReader as fdr cmg = fdr.DataReader('CMG', '2018-01-01', '2021-04-16').reset_index() import plotly.express as px fig = px.line(cmg, x="Date", y="Close", title='Chipotle Stock Price') fig.show() line=fig.to_json()
2. 치폴레 매출액/영업이익
그다음으로 가장 중요한 기업 매출액, 영업이익 실적을 살펴보도록 하겠다. 식음료 기업이기 때문에 영업이익률을 그다지 높지는 않지만 그래도 매년 꾸준히 상승 추세를 나타나고 있다. 코로나에도 오히려 매출이 증가하여 치폴레가 확실히 저력이 있는 기업인 점을 틀림없어 보인다.
import plotly.graph_objects as go from plotly.subplots import make_subplots import requests import pandas as pd api='~~' url=f'https://financialmodelingprep.com/api/v3/income-statement/CMG?limit=400&apikey={api}' res=requests.get(url) obj=res.json() df=pd.DataFrame(obj) df['operatingIncome(%)']=(df['operatingIncome']/df['revenue'])*100 # Create figure with secondary y-axis fig = make_subplots(specs=[[{"secondary_y": True}]]) # Add traces fig.add_trace( go.Bar(x=df['date'], y=df['revenue'], name="Revenue"), secondary_y=False, ) fig.add_trace( go.Bar(x=df['date'], y=df['operatingIncome'], name="OperatingIncome"), secondary_y=False, ) fig.add_trace( go.Line(x=df['date'], y=df['operatingIncome(%)'], name="OperatingIncome(%)"), secondary_y=True, ) # Add figure title fig.update_layout( title_text="Chipotle" ) # Set x-axis title fig.update_xaxes(title_text="Date") fig.show() bar=fig.to_json() bar
3. 치폴레 매출액/영업이익
마지막으로 치폴레 자산 구성 비중을 확인하도록 하겠다. 주식 투자에 있어 내가 개인적으로 가장 중요하게 보는 지표가 현금이 전체 자산에서 차지하는 비중인데, 2020년 기준으로 현금 비중이 16%로 지난 연도 대비 감소하였지만 그럼에도 준수한 수준이다.
from plotly.subplots import make_subplots url2=f'https://financialmodelingprep.com/api/v3/balance-sheet-statement/CMG?limit=120&apikey={api}' res2=requests.get(url2) obj2=res2.json() df2=pd.DataFrame(obj2) assets=df2[['date','cashAndShortTermInvestments','netReceivables', 'inventory','otherCurrentAssets','totalNonCurrentAssets','totalAssets']] assets['cashAndShortTermInvestments%']=assets['cashAndShortTermInvestments']/assets['totalAssets'] assets['netReceivables%']=assets['netReceivables']/assets['totalAssets'] assets['inventory%']=assets['inventory']/assets['totalAssets'] assets['otherCurrentAssets%']=assets['otherCurrentAssets']/assets['totalAssets'] assets['totalNonCurrentAssets%']=assets['totalNonCurrentAssets']/assets['totalAssets'] assets=assets.set_index('date') ass=assets.T ass=ass[6:] # Create subplots: use 'domain' type for Pie subplot fig = make_subplots(rows=3, cols=2, specs=[[{'type':'domain'}, {'type':'domain'}], [{'type':'domain'}, {'type':'domain'}], [{'type':'domain'},{'type':'domain'}] ]) fig.add_trace(go.Pie(labels=ass.index, values=ass['2016-12-31'], name="2016"), 1, 1) fig.add_trace(go.Pie(labels=ass.index, values=ass['2017-12-31'], name="2017"), 1, 2) fig.add_trace(go.Pie(labels=ass.index, values=ass['2018-12-31'], name="2018"), 2, 1) fig.add_trace(go.Pie(labels=ass.index, values=ass['2019-12-31'], name="2019"), 2, 2) fig.add_trace(go.Pie(labels=ass.index, values=ass['2020-12-31'], name="2020"), 3, 1) # Use `hole` to create a donut-like pie chart fig.update_traces(hole=.4, hoverinfo="label+percent+name") fig.update_layout( title_text="Chipotle Assets", # Add annotations in the center of the donut pies. annotations=[dict(text='2016', x=0.197, y=0.895, font_size=11, showarrow=False), dict(text='2017', x=0.80, y=0.895, font_size=11, showarrow=False), dict(text='2018', x=0.197, y=0.5, font_size=11, showarrow=False), dict(text='2019', x=0.80, y=0.5, font_size=11, showarrow=False), dict(text='2020', x=0.197, y=0.123, font_size=11, showarrow=False) ]) fig.show()
'Data Analysis > Investment' 카테고리의 다른 글
구글트렌드 & 네이버 데이터랩으로 지난 1년간 국내 메이저 카드사 검색량 트렌드 분석 (0) 2021.06.02 국내 상장 시중 은행 18년 ~ 20년 배당 내역 분석 With Python, Open Dart API (0) 2021.05.18 MAGA(Microsoft, APPLE, GOOGLE, AMAZON) 기업 주식 비교 분석 With Python (0) 2021.04.10 네이버 쇼핑 내 등록된 홍삼/종합비타민/유산균 제품 브랜드 알아보자 (0) 2021.04.08 국내 시중 은행 통계 데이터 분석 #1-1 - 인터넷 전문은행 카카오뱅크 임직원 수 현황 (0) 2021.04.04