COVID-19 and the Big Tech

Muhammad Balogun
7 min readJun 8, 2021

--

image credit: ft.com
image credit: ft.com

COVID-19

Coronavirus disease 2019 (COVID-19) is a contagious disease caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). The first known case was identified in Wuhan, China, in December 2019. The disease has since spread becoming a global pandemic.

As of May 2021, more than 170 million cases have been confirmed with more than 3.5 million deaths attributed to COVID-19 worldwide, making it one of the deadliest pandemics in human history.[1]

COVID-19 is not only a global pandemic and public health crisis; it has also severely affected the global economy and financial markets leading to a rise in unemployment, and disruptions in the transportation, service, and manufacturing industries.

Big Tech

Big Tech, the Tech Giants, the Big Four, the Big Five, FAAG, FAANG, are some of the names given to the largest and most dominant companies in the information technology industry of the United States. These companies have been among the most valuable public companies globally, each having had a maximum market capitalization ranging from around $500 billion to around $2 trillion USD.[2]

The tech industry is not immune to the effects of the pandemic, leading to disruption of the value chain, financials and taxes, eating up inventories while most products couldn’t be shipped. However, the disruption has caused an accelerated growth of remote working, rise in demand for cloud services and more reliance on technology to get job done.

For the sake of this article, we would consider all the companies mentioned in any of the names above — namely Amazon, Apple, Facebook, Google, Microsoft and Netflix.

In this article, I want to review the stock history of the major tech companies in the last 3 years with an objective to visualize how they reacted to the pandemic.

To achieve this, we would rely on Python programming language and the various libraries for data analysis and visualization.

Retrieving Stock Data

There are many companies who provide stock data for free and others for a cost. We would be using Yahoo Finance API to retrieve the required data. It is free and easily accessible.

Install the relevant libraries if they are not installed already. The code below would install pandas.

pip install pandas

You can easily install other libraries by running ‘pip install library-name’.

Then import the relevant libraries.

#import relevant librariesimport yfinance as yf #for stock prices
import pandas as pd #for data manipulation and analysis
#and these for data visualization
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inlineimport plotlyimport plotpy.express as px
import cufflinks as cf
cf.go_offline()

Share Price

A share is the single smallest denomination of a company’s stock.

A share price — or a stock price — is the amount it would cost to buy one share in a company. The price of a share is not fixed, but fluctuates according to market conditions. It will likely increase if the company is perceived to be doing well, or fall if the company isn’t meeting expectations.[3]

With the YFinance API, we can extract the share price of listed companies by using the history() method. Firstly, get the ticker symbol of each stock and create an object to extract the needed data.

#get the ticker symbol of each stock and create an object to extract data.AAPL = yf.Ticker("AAPL")
GOOGL= yf.Ticker("GOOGL")
AMZN = yf.Ticker("AMZN")
FB = yf.Ticker("FB")
MSFT = yf.Ticker("MSFT")
NFLX = yf.Ticker("NFLX")

The period parameter gives us the opportunity to limit the period under review as we deem fit. The options for period are 1 day (1d), 5d, 1 month (1mo) , 3mo, 6mo, 1 year (1y), 2y, 5y, 10y, ytd, and max.

For this article, we would limit our period to the past 3 years. This gives us a good idea of the trend before COVID-19 struck.

Apple = AAPL.history(period="3y")
Google = GOOGL.history(period="3y")
Amazon = AMZN.history(period="3y")
Facebook = FB.history(period="3y")
Microsoft = MSFT.history(period="3y")
Netflix = NFLX.history(period="3y")

Then, create a list for the share prices and call it tickers.

tickers = ['Amazon', 'Apple', 'Facebook', 'Google', 'Microsoft', 'Netflix']

Now, let’s combine all the Dataframes into one, and call it share_prices

share_prices =pd.concat([Amazon, Apple, Facebook, Google, Microsoft, Netflix],axis=1,keys=tickers)

…add column names and check your data to confirm it’s what you want. Just check the first 5 rows.

share_prices.columns.names = ['Ticker','Stock Info']share_prices.head()

Exploratory Data Analysis (EDA)

Exploratory data analysis (EDA) is used to analyze and investigate data sets and summarize their main characteristics, often employing data visualization methods.

The main purpose of EDA is to help look at data before making any assumptions. It can help identify obvious errors, as well as better understand patterns within the data, detect outliers or anomalous events, find interesting relations among the variables.[4]

Firstly, some descriptive analysis…

share_prices.describe(include= 'all')

We want to check for the lowest and highest share prices within the period under review. In addition, we would like to see how these fit within the bigger COVID context.

Let’s create an empty DataFrame called daily_outlook to hold the daily outlook for each company’s share. This is important to monitor the relative change in the fortunes of the companies.

The pct_change() in pandas will be used. This function calculates the percentage change between the current and a previous element; the default is to calculate the percentage change from the immediately previous row.

daily_outlook = pd.DataFrame()for tick in tickers:
daily_outlook[tick+' Daily Outlook'] = share_prices[tick]['Close'].pct_change()
daily_outlook.head()

We will use pairplot() method to plot multiple pairwise bivariate distribution to show the relations.

sns.pairplot(daily_outlook[1:])

Let’s check the trend of the closing stock over the period under review.

for tick in tickers:
share_prices[tick]['Close'].plot(figsize=(12,4),label=tick)
plt.legend()

We can use plotly which makes it more interactive.

# plotly
share_prices.xs(key='Close',axis=1,level='Stock Info').iplot()

The heatmap…

sns.heatmap(share_prices.xs(key='Close',axis=1,level='Stock Info').corr(),annot=True)

A Closer look at the COVID period

Now, let us consider the daily_outlook again to have a closer look that the data. We would use Plotly’s range slider to interact with the line plots.

daily_outlook.reset_index(inplace= True)
daily_outlook

Amazon

fig = px.line(daily_outlook, x='Date', y=daily_outlook['Amazon Daily Outlook'], range_x=['2020-03-01','2021-03-01'])fig.update_xaxes(rangeslider_visible=True)
fig.show()

Apple

fig = px.line(daily_outlook, x='Date', y=daily_outlook['Apple Daily Outlook'], range_x=['2020-03-01','2021-03-01'])fig.update_xaxes(rangeslider_visible=True)
fig.show()

Facebook

fig = px.line(daily_outlook, x='Date', y=daily_outlook['Facebook Daily Outlook'], range_x=['2020-03-01','2021-03-01'])fig.update_xaxes(rangeslider_visible=True)
fig.show()

Google

fig = px.line(daily_outlook, x='Date', y=daily_outlook['Google Daily Outlook'], range_x=['2020-03-01','2021-03-01'])fig.update_xaxes(rangeslider_visible=True)
fig.show()

Microsoft

fig = px.line(daily_outlook, x='Date', y=daily_outlook['Microsoft Daily Outlook'], range_x=['2020-03-01','2021-03-01'])fig.update_xaxes(rangeslider_visible=True)
fig.show()

Netflix

fig = px.line(daily_outlook, x='Date', y=daily_outlook['Netflix Daily Outlook'], range_x=['2020-03-01','2021-03-01'])fig.update_xaxes(rangeslider_visible=True)
fig.show()

Conclusion

The essence of this article is not to predict the long term effects of the virus on the tech sector, as the challenges are evolving with every new strain, but to see how well or otherwise the sector has reacted to the pandemic.

The spread of the virus is likely to continue disrupting economic activities; hence, the financial markets will remain volatile and there will be some long term financial and economic consequences on the global economy. The massive roll-out of vaccines gives hope that the global economy would surely return to optimal level, but there is still a long way to go.

From the foregoing, the Big Tech seems to be reacting positively well to the situation. The share prices of the major players have witnessed significant leap during this period. Standing at the precipice of the Information revolution, the technology industry has found ingenious ways to weather the effects and come out even stronger. It is hoped that that would spark further creativity, and enhance innovation in other fields of human endeavour.

You can check out the codes on:

References

[1] https://www.who.int/docs/default-source/coronaviruse/situation-reports/20200423-sitrep-94-covid-19.pdf

[2] https://en.wikipedia.org/wiki/Big_Tech

[3] https://www.ig.com/en/glossary-trading-terms/share-price-definition

[4] https://www.ibm.com/cloud/learn/exploratory-data-analysis

--

--

Muhammad Balogun

A Degree in Mathematics and a Masters in Business; the best part of knowledge is our ability to explain it in beautiful words.