The Reason Why I Own Shares of the Gap

On June 26th, 2020, Gap Inc. announced a collaboration between its namesake brand and Kanye West's Yeezy apparel label. Under Kanye’s creative direction, the Yeezy design studio is to develop the new line to deliver modern, elevated basics for men, women, and kids at accessible price points that will sell in Gap stores and on its website starting in 2021. Being the sneaker head and hypebeast that I am, I knew that this was an opportunity to not only buy into the hype, but make an investment. It seems like everything that Kanye has released or collaborated on in the past few years has been in especially high demand. Since Kanye joined Adidas back in 2013, Adidas went from generating 14.8 billion euros in sales to 16.9 billion euros in 2015, which was when Kanye released his first Adidas sneaker, the Adidas Yeezy 750 Boost in February 2015. In this post I’ll illustrate how Adidas’ stock price increases with releases and re-releases of Adidas Yeezy footwear, as evidence to show why I think investing in Gap is a good long term stock hold.

If you want to check out how Kanye West’s Yeezy sneaker releases have impacted Adidas stock prices, check out the interactive visualization below (works best of desktop). These visualizations, for both Adidas and The Gap, were created using Plotly, an interactive, open-source, and browser-based graphing library for Python. You can optionally use the date slider below the line chart to narrow in on specific time periods you’re interested in, click on any of the annotations which will bring you to a StockX sneaker page or to a related article, and lastly, you can hover over the line chart to get the exact stock price on any given day. The beauty of Plotly is that, most, if not everything in a Plotly visualization can be customized to your liking, and I chose to use this tool for that reason. Plotly also has options that allow users to easily embed visualizations into websites through Plotly Chart Studio, and its API, which can be accessed from a Jupyter notebook. I’ll walk you through how I leveraged all these tools throughout this post.

It’s only been a few months since Kanye and the Gap announced their partnership, and it’s amazing to see that Gap’s stock price has already nearly doubled.

The Yeezy Gap clothing line is slated to be introduced in the first half of 2021, and judging by how much the Adidas stock price has increased over the years through popular demand and hype around the Yeezy footwear line, the Gap may be a solid long term buy. Lastly, I am not a financial adviser so please do not take this as me giving you financial advice, this post is intended to showcase many of my interests; sneakers, hip-hop, and coding. With that being said, let’s get into how I generated these visualizations.

How I Did It

  1. Obtain Financial Data - Use built in Pandas function to extract stock price data from Yahoo Finance

  2. Create Visualization - Create and customize Plotly line chart using Gap and Adidas stock price time series data

  3. Push to Plotly Chart Studio - Use Plotly Chart Studio API to push visualizations to Chart Studio which will host the visualization and generate html for embedding into website

You can view the full script here

Obtaining Financial Data

A quick and easy way to extract data from various internet sources into a Pandas data frame is by using functions from pandas_datareader.data API. Through using pandas_datareader, in a few lines of code, we can obtain data about Gap’s closing stock price for each day in a given time period. Note that you must have pandas installed as a prerequisite, but the code below demonstrates how to get the financial data.

Screen+Shot+2021-01-30+at+1.31.36+PM.jpg

Data frame output from pandas_datareader.data call to Yahoo Finance for GPS (Gap Stock Ticker). Note that the date is located in the index of the data frame and that the stock close price isn’t formatted as a currency. We will handle this later.

Creating the Visualization

In the beginning of this post I noted that I used Plotly to create these visualizations. More specifically, I used the Plotly Express, the module (imported as px) which contains functions that can create entire figures at once. Plotly Express is a built-in part of the Plotly library, and is the recommended starting point for creating some of the most common figures. I found Plotly Express very easy to work with as it offers great customizability and clear and concise documentation. I used the Plotly Line Chart documentation to help guide me in the creation and styling of my own line charts. Plotly’s Text and Annotation documentation was also super beneficial to me as this project is largely focused on highlighting the factors that may affect the stock price. To install Plotly Express, go to your terminal, and enter pip install plotly.

This code will only generate the interactive visualization; however, if you want to be able to embed the visualization on your website, you’ll need to upload your figure to Plotly Chart Studio. The next section will explain how to upload your figure to Chart Studio via Jupyter notebook.

Publish to Plotly Chart Studio

Plotly Chart Studio provides a web-service for hosting visualizations. Visualizations are saved inside your online Chart Studio account where you can make edits, create graphs, and share data. This section will show you how to push Plotly visualizations straight from your Jupyter notebook to Plotly Chart Studio, where you can get the html code to embed that figure in your website or dashboard. To do so, you must

  1. Install Chart Studio via your terminal; pip install chart_studio

  2. Go to Plotly Chart Studio and create an account

  3. Next, go to Profile Settings -> API Keys to get your username and API Key (see screenshot for location). You’ll need this info to add to your notebook

  4. Use the code below to push your Plotly visualization to your Chart Studio Account

Screen Shot 2021-01-31 at 10.59.14 AM.png

After you push your visualization to your account. Go to your Chart Studio account home page. Click on Share -> Embed on the visualization to get the html code to embed on your site.

I really hope you enjoyed this post and ultimately learned something new. If you’d like to view the whole script or download it, you can do so here. If you have any questions about what I wrote here or just want to leave some feedback about this post, feel free to do so in the comment section below. If you’ve read some of my previous posts, you’ll know that I am learning Python, and through blogging, I can advance my skills with these personal projects and exercises that are in my areas of interest. If you’d like to work on a project together or want to recommend ways to improve this script, please don’t hesitate to reach out. Thanks for reading.

Previous
Previous

Sports Betting With the Boys - NBA Prop Bets - Part 1

Next
Next

Whole Lotta WHAT? Playboi Carti Lyrical Analysis