3/17/2023 0 Comments Python return multipanel figure![]() netflix_cum_returns = (netflix_daily_returns + 1).cumprod() To calculate the cumulative returns we will use the cumprod() function. To calculate the growth of our investment or in other word, calculating the total returns from our investment, we need to calculate the cumulative returns from that investment. Plotting the daily and monthly returns are useful for understanding the daily and monthly volatility of the investment. # Freq: M, Name: Adj Close, dtype: float64Ĭalculating the cumulative returns for the Netflix stock print(netflix_monthly_returns.head()) # Date Looking at the head of the monthly returns. print(netflix_daily_returns.head()) # Date Looking at the head of the daily returns. Netflix_monthly_returns = netflix.resample('M').ffill().pct_change() netflix_daily_returns = netflix.pct_change() We will calculate the monthly and daily price returns. We have already downloaded the price data for Netflix above, if you haven’t done that then see the above section. We will again use pandas package to do the calculations. ![]() Once we downloaded the stock prices from yahoo finance, the next thing to do is to calculate the returns. ot()Ĭalculating the daily and monthly returns for individual stock Next we will chart the Netflix’s adjusted closing price. netflix = web.get_data_yahoo("NFLX",Įnd = "") print(netflix.head()) # High Low. To see just how well Netflix’s stock has performed, we will start by downloading the historical price for Netflix and then perform the return calculations. Today Netflix seems like an unstoppable force in the media landscape. Its original programs have won several Emmy awards. Netflix started as a content delivery platform, but today its responsible for content creation as well. Old media companies like CBS, Fox, Viacom, Disney etc are under threat from the new way of consuming media. ![]() It has changed the industry landscape and pushed Blockbuster our of business. It was responsible for producing a new category of business - subscription based online streaming. Netflix has seen phenomenal growth since 2009.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |