Codecademy Forums

Netflix Data Capstone Project

Hey all,
I finished a capstone project in Data Science. This time I’m sharing it with the Community.
I’m grateful for any comments.
Thanks!
Zofia

Netflix Stock Profile in 2017.pdf (102.9 KB)

1 Like

im adding mine onto your thread. I think that these projects need dedicated threads.
how did you get the grids to not go over the plots/bars/etc? every time I used grid() it covered them?

Netflix Stock Profile 2017.pdf (253.0 KB)

I didn’t even noticed it, to be honest. I used sns.set_style('whitegrid')
for the violin chart, but I’m not sure it carries for the next one, and it’s seaborn and pyplot.
Anyways, I’m putting all the code I used for charts.

`sns.set_style(‘whitegrid’)
sns.set_palette(‘muted’)
ax = sns.violinplot(data=netflix_stocks_quarterly, x=‘Quarter’, y=‘Price’)

ax.set_title(‘Distribution of 2017 Netflix Stock Prices by Quarter’)
ax.set_xlabel(‘Business Quarters in 2017’)
ax.set_ylabel(‘Closing Stock Price’)
plt.show()`

`x_positions = [1, 2, 3, 4]
chart_labels = [“1Q2017”,“2Q2017”,“3Q2017”,“4Q2017”]
earnings_actual =[.4, .15,.29,.41]
earnings_estimate = [.37,.15,.32,.41 ]

plt.scatter(x=x_positions, y=earnings_actual, color=‘red’, alpha=0.5)
plt.scatter(x=x_positions, y=earnings_estimate, color=‘blue’, alpha=0.5)
plt.legend([‘Actual’, ‘Estimate’])
plt.xticks(x_positions, chart_labels)
plt.title(‘Earnings Per Share in Cents’)`

`# The metrics below are in billions of dollars
revenue_by_quarter = [2.79, 2.98, 3.29, 3.7]
earnings_by_quarter = [.0656, .12959, .18552, .29012]
#why quarters are like that? and not only 2017
quarter_labels = [“1Q2017”,“2Q2017”,“3Q2017”, “4Q2017”]

Revenue

n = 1 # This is our first dataset (out of 2)
t = 2 # Number of dataset
d = 4 # Number of sets of bars
w = 0.8 # Width of each bar
bars1_x = [telement + wn for element
in range(d)]

Earnings

n = 2 # This is our second dataset (out of 2)
t = 2 # Number of dataset
d = 4 # Number of sets of bars
w = 0.8 # Width of each bar
bars2_x = [telement + wn for element
in range(d)]

#fig = plt.figure()

plt.title(‘Revenue and Earnings by Quarter’)

labels = [“Revenue”, “Earnings”]

middle_x = [ (a + b) / 2.0 for a, b in zip(bars1_x, bars2_x)]

plt.xticks(middle_x, quarter_labels)
plt.ylabel(‘In Bilions USD’)
plt.bar(bars1_x, revenue_by_quarter)
plt.bar(bars2_x, earnings_by_quarter)
plt.legend([“Revenue”, “Earnings”], loc=0)
plt.show()`

`# Left plot Netflix
ax1 = plt.subplot(1,2,1)
plt.title(‘Netflix’)

plt.ylabel(‘Stock Price’)
ax1.set_xticks(range(12))
ax1.set_xticklabels([‘01’, ‘02’, ‘03’, ‘04’, ‘05’, ‘06’, ‘07’, ‘08’, ‘09’, ‘10’, ‘11’, ‘12’])
plt.xlabel(‘Date’)
plt.subplots_adjust(wspace=.5)
plt.plot(netflix_stocks[‘Date’], netflix_stocks[‘Price’])

Right plot Dow Jones

ax2 = plt.subplot(1,2,2)

plt.ylabel(‘Stock Price’)
plt.xlabel(‘Date’)
plt.title(‘Dow Jones’)
ax2.set_xticks(range(12))
ax2.set_xticklabels([‘01’, ‘02’, ‘03’, ‘04’, ‘05’, ‘06’, ‘07’, ‘08’, ‘09’, ‘10’, ‘11’, ‘12’])
plt.subplots_adjust(wspace=.5)
plt.plot(dowjones_stocks[‘Date’], dowjones_stocks[‘Price’])
plt.show()`

I changed the quarters names in the bar chart, it had 2018 in it, I don’t know if I should have.

In general, I like your slides! It was the 1st time I used powerpoint (I usually use beamer from latex), and I see it looks better with clean frames.

1 Like