In recent years, the landscape of global industries has been dramatically reshaped by the twin forces of technology and artificial intelligence (AI). These sectors have become the primary drivers of the S&P 500, pushing the envelope of innovation and efficiency. However, despite the remarkable advancements and contributions of these burgeoning fields, the broader spectrum of the top 100 industries is facing a confluence of challenges. The specter of recession looms large, casting a shadow over the once-bright prospects of diverse sectors. From traditional manufacturing to retail, from the energy sector to transportation, industries are grappling with the economic downturn, supply chain disruptions, and shifting consumer behaviors. As we navigate this complex terrain, it is crucial for investors, businesses, and employees to remain vigilant and adaptive. The current climate calls for a strategic reassessment of operations, investment, and growth plans to ensure resilience in the face of these headwinds.

  • S&P with Tech and Without Tech
import yfinance as yf
import pandas as pd
import matplotlib.pyplot as plt

# Download S&P 500 index data for 2022
sp500 = yf.download('^GSPC', start='2022-01-01', end='2022-12-31')

# Plot the S&P 500 index data
plt.figure(figsize=(14, 7))
plt.plot(sp500['Close'], label='S&P 500')
plt.title('S&P 500 Index Over 2022')
plt.xlabel('Date')
plt.ylabel('Close Price')
plt.legend()
plt.show()

# List of companies to exclude
companies_to_exclude = ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'NVDA']

# Download historical data for the companies
excluded_data = yf.download(companies_to_exclude, start='2022-01-01', end='2022-12-31')['Close']

# You would need to calculate the adjusted close prices for the S&P 500
# This is a complex calculation that would involve understanding the weight of each company in the index
# and then adjusting the index value accordingly. This is a simplification.
# For the purpose of this example, let's assume we just subtract the close prices (which is not correct).
adjusted_sp500 = sp500['Close'].copy()
for company in companies_to_exclude:
    adjusted_sp500 -= excluded_data[company]

# Plot the adjusted S&P 500 index data
plt.figure(figsize=(14, 7))
plt.plot(adjusted_sp500, label='Adjusted S&P 500')
plt.title('Adjusted S&P 500 Index Over 2022 (Excluding Specific Companies)')
plt.xlabel('Date')
plt.ylabel('Adjusted Close Price')
plt.legend()
plt.show()
Table of Contents hide

Financial Services

This sector includes banks, investment funds, insurance companies, and real estate firms. It serves both individual consumers and businesses with financial transactions, management, and advisory services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for a company in the Financial Services sector
ticker_symbol = 'JPM'  # JPMorgan Chase & Co.

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2022-12-31')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title('Closing Price of ' + ticker_symbol)
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.show()

Real Estate

Encompasses buying, selling, leasing, and managing properties and land. It’s a critical driver of economic growth, involving both residential and commercial properties.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for a Real Estate sector ETF
ticker_symbol = 'VNQ'  # Vanguard Real Estate ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title('Closing Price of ' + ticker_symbol)
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.show()

Health Care

Comprises hospitals, clinics, and other service providers, including medical equipment and pharmaceutical manufacturers. It focuses on treating patients and maintaining public health.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Health Care sector ETF
ticker_symbol = 'XLV'  # Health Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title('Closing Price of ' + ticker_symbol)
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Retail

This sector sells consumer goods and services directly to the public, from large chains and department stores to online businesses and small local shops.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Retail sector ETF
ticker_symbol = 'XRT'  # SPDR S&P Retail ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title('Closing Price of ' + ticker_symbol)
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Construction

Involves the building of infrastructure, residential, and commercial properties. It includes contractors, construction material suppliers, and related services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Construction sector ETF
ticker_symbol = 'ITB'  # iShares U.S. Home Construction ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title('Closing Price of ' + ticker_symbol)
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Manufacturing

Encompasses the production of goods, ranging from consumer products to industrial machinery. It’s a key sector for economic development and employment.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Manufacturing sector ETF
ticker_symbol = 'XLI'  # Industrial Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Technology (Software & Hardware)

Includes companies producing electronics, computers, mobile devices, and software. It’s a rapidly evolving sector with significant R&D investment.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Technology sector ETF
ticker_symbol = 'XLK'  # Technology Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Automotive

Focuses on the design, manufacture, and sale of vehicles, including cars, trucks, and motorcycles, as well as parts and service.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for a major automotive company
ticker_symbol = 'F'  # Ford Motor Company

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Oil and Gas Exploration and Production

Involves the discovery and extraction of fossil fuels, a critical energy source for the global economy.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Oil and Gas Exploration and Production sector ETF
ticker_symbol = 'XOP'  # SPDR S&P Oil & Gas Exploration & Production ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Pharmaceuticals

This sector develops, produces, and markets drugs and vaccines for medical use, with a strong focus on R&D.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Pharmaceuticals sector ETF
ticker_symbol = 'PJP'  # Invesco Dynamic Pharmaceuticals ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Electronics

Involves the design and manufacture of electronic devices, including consumer electronics, semiconductors, and circuit boards.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Semiconductor ETF
ticker_symbol = 'SMH'  # VanEck Vectors Semiconductor ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Telecommunications

Provides communication services, both wired and wireless, as well as the infrastructure for internet and data services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Telecommunications sector ETF
ticker_symbol = 'VOX'  # Vanguard Communication Services ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Agriculture

The cultivation of plants and livestock to provide food, fiber, medicinal plants, and other products to sustain and enhance life.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Agriculture sector ETF
ticker_symbol = 'MOO'  # VanEck Vectors Agribusiness ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Chemicals

Produces chemical substances for use in products like plastics, pharmaceuticals, and fertilizers.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Materials sector ETF, which includes Chemicals
ticker_symbol = 'XLB'  # Materials Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Mining

Extraction of minerals and resources from the earth, including metals, coal, and precious stones.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Mining sector ETF
ticker_symbol = 'PICK'  # iShares MSCI Global Metals & Mining Producers ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Food & Beverage

Encompasses companies involved in processing raw food materials, packaging, and distributing them.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Food & Beverage sector ETF
ticker_symbol = 'PBJ'  # Invesco Dynamic Food & Beverage ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Education

Includes institutions that provide instruction and training in a wide variety of subjects. This sector is crucial for societal development and personal growth.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Education sector
education_tickers = ['CHGG', 'LRN', 'TWOU']  # Chegg, Stride Inc., 2U Inc.

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in education_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'Closing Price of {ticker}')

plt.title('Closing Price of Education Sector Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Transportation and Logistics

Covers the movement of goods and people, including logistics companies, airlines, and public transit.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Transportation and Logistics sector ETF
ticker_symbol = 'IYT'  # iShares Transportation Average ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Utilities (Electricity, Water, Waste Management)

Provides essential services like power, water, and waste management to households and businesses.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Utilities sector ETF
ticker_symbol = 'XLU'  # Utilities Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Hospitality and Tourism

Comprises businesses that offer lodging, food services, travel, and recreational activities to travelers and tourists.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Hospitality and Tourism sector ETF
ticker_symbol = 'PEJ'  # Invesco Dynamic Leisure and Entertainment ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Professional Services (Legal, Consulting)

Offers specialized expertise to businesses and individuals, including legal advice, management consulting, and more.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Professional Services sector
professional_services_tickers = ['ACN', 'KFRC']  # Accenture and Kforce Inc.

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in professional_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'Closing Price of {ticker}')

plt.title('Closing Price of Professional Services Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Insurance

Provides risk management to individuals and companies, offering policies for health, property, and other forms of coverage.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Insurance sector ETF
ticker_symbol = 'KIE'  # SPDR S&P Insurance ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Aerospace and Defense

Involves the manufacture of aircraft, spacecraft, and related systems, including defense equipment.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Aerospace and Defense sector ETF
ticker_symbol = 'ITA'  # iShares U.S. Aerospace & Defense ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Consumer Goods

Produces goods used by consumers, from food and clothing to appliances and electronics.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Consumer Goods sector ETF
ticker_symbol = 'XLY'  # Consumer Discretionary Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Media and Entertainment

Encompasses the production and distribution of content, such as films, TV shows, music, and books.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Media and Entertainment sector ETF
ticker_symbol = 'PBS'  # Invesco Dynamic Media ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Renewable Energy

Focuses on producing energy from renewable sources, such as solar, wind, and hydro power.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Renewable Energy sector ETF
ticker_symbol = 'ICLN'  # iShares Global Clean Energy ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Textiles and Apparel

Involves the production of raw materials, like cotton and wool, and the design and manufacture of clothing and accessories.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Textiles and Apparel sector ETF
ticker_symbol = 'XRT'  # SPDR S&P Retail ETF, which includes apparel retailers

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Forestry and Paper Products

Includes the management of forests, the harvesting of timber, and the production of paper and wood products.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Forestry and Paper Products sector
forestry_paper_tickers = ['IP', 'WRK', 'WY']  # International Paper, WestRock, Weyerhaeuser

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in forestry_paper_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'Closing Price of {ticker}')

plt.title('Closing Price of Forestry and Paper Products Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Commercial Services and Supplies

Offers support services to businesses, including cleaning, office supplies, and security services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Commercial Services and Supplies sector ETF
ticker_symbol = 'XLI'  # Industrials Select Sector SPDR Fund

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Industrial Machinery

Produces equipment used in various industries, from construction to manufacturing and agriculture.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Industrial Machinery sector
industrial_machinery_tickers = ['CAT', 'DE', 'ITW']  # Caterpillar Inc., Deere & Company, Illinois Tool Works

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in industrial_machinery_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Industrial Machinery Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Packaging

Involves the design and production of packaging materials to protect and market products.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Packaging sector
packaging_tickers = ['IP', 'WRK', 'PKG']  # International Paper, WestRock, Packaging Corporation of America

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in packaging_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Packaging Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Metals and Mining

Focuses on the extraction and processing of metals used in various industries, from construction to electronics.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Metals and Mining sector ETF
ticker_symbol = 'XME'  # SPDR S&P Metals & Mining ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Marine

Covers the design, construction, and operation of ships and marine equipment, as well as maritime services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Marine sector ETF
ticker_symbol = 'SEA'  # Invesco Shipping ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Railroads

Provides rail transportation for passengers and freight, along with the necessary infrastructure and services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Railroads sector
railroad_tickers = ['UNP', 'NSC', 'CSX']  # Union Pacific, Norfolk Southern, CSX Corporation

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in railroad_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Railroad Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Air Transportation

Involves the operation of airlines and airports, providing global and domestic travel for passengers and cargo.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Air Transportation sector ETF
ticker_symbol = 'JETS'  # U.S. Global Jets ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Space Industry

Encompasses the development and deployment of spacecraft and satellites, including exploration and commercial ventures.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Space Industry sector
space_industry_tickers = ['BA', 'LMT', 'NOC', 'SPCE']  # Boeing, Lockheed Martin, Northrop Grumman, Virgin Galactic

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in space_industry_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Space Industry Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Biotechnology

Applies science and technology to living organisms to develop products, often in the health and agricultural sectors.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Biotechnology sector ETF
ticker_symbol = 'IBB'  # iShares Nasdaq Biotechnology ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Information Services

Offers data processing, hosting, and related services to businesses and consumers.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for the Information Services sector ETF
ticker_symbol = 'VGT'  # Vanguard Information Technology ETF

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol}')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Fishing and Aquaculture

The capture of wild fish and the cultivation of aquatic organisms for food.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for a company in the Fishing and Aquaculture sector
ticker_symbol = 'AQB'  # AquaBounty Technologies

# Get historical data for this ticker
data = yf.download(ticker_symbol, start='2022-01-01', end='2023-01-01')

# Plot the closing prices
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Closing Price')
plt.title(f'Closing Price of {ticker_symbol} - Fishing and Aquaculture Sector')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Tobacco

Involves the production and sale of tobacco products, such as cigarettes and cigars.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Tobacco sector
tobacco_tickers = ['MO', 'PM', 'BTI']  # Altria Group, Philip Morris International, British American Tobacco

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in tobacco_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Tobacco Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Household and Personal Products

Manufactures goods like cleaning products, toiletries, and diapers.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Household and Personal Products sector
household_tickers = ['PG', 'CL', 'KMB']  # Procter & Gamble, Colgate-Palmolive, Kimberly-Clark Corporation

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in household_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Household and Personal Products Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Luxury Goods

Produces and sells high-end products, from designer clothing to luxury cars and jewelry.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Luxury Goods sector
luxury_goods_tickers = ['LVMUY', 'CPRI', 'TPR']  # LVMH Moët Hennessy Louis Vuitton, Capri Holdings, Tapestry

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in luxury_goods_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Luxury Goods Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Publishing

The industry related to the production and dissemination of literature or information – the activity of making information available for public view.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Publishing sector
publishing_tickers = ['NYT', 'NWSA', 'PSO']  # The New York Times Company, News Corp, Pearson PLC

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in publishing_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Publishing Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Sporting Goods

Involves the production and sale of equipment and apparel for sports and fitness activities.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Sporting Goods sector
sporting_goods_tickers = ['NKE', 'UAA', 'COLM']  # Nike, Under Armour, Columbia Sportswear

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in sporting_goods_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Sporting Goods Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Toys and Games

Designs, manufactures, and markets toys and games for children and adults.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Toys and Games sector
toys_games_tickers = ['HAS', 'MAT']  # Hasbro and Mattel

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in toys_games_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Toys and Games Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Gambling

Operates casinos, lotteries, and betting services, providing entertainment and gaming experiences.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Gambling sector
gambling_tickers = ['LVS', 'MGM', 'WYNN']  # Las Vegas Sands, MGM Resorts, Wynn Resorts

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in gambling_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Gambling Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Art and Auction

The business of selling art pieces and collectibles through auctions or galleries.

Category with no with Data

Music Industry

Comprises companies and individuals that make money by creating and selling music.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Music Industry sector
music_industry_tickers = ['SPOT', 'WMG', 'LYV']  # Spotify, Warner Music Group, Live Nation Entertainment

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in music_industry_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Music Industry Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Photography

Involves the taking, processing, and selling of photographs and related services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for a company in the Photography sector
photography_ticker = 'KODK'  # Eastman Kodak Company

# Get historical data for this ticker
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for the ticker
plt.figure(figsize=(14, 7))

data = yf.download(photography_ticker, start=start_date, end=end_date)
plt.plot(data['Close'], label=f'{photography_ticker} Closing Price')

plt.title('Closing Price of Eastman Kodak Company')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Footwear

The design, manufacture, and sale of shoes and related products.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Footwear sector
footwear_tickers = ['NKE', 'SKX', 'UAA']  # Nike, Skechers USA, Under Armour

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in footwear_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Footwear Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Cybersecurity

Protects systems, networks, and programs from digital attacks and ensures the integrity of data.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Cybersecurity sector
cybersecurity_tickers = ['PANW', 'FTNT', 'CRWD']  # Palo Alto Networks, Fortinet, CrowdStrike Holdings

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in cybersecurity_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Cybersecurity Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Data Centers and Hosting Services

Provides infrastructure and services for website hosting and data storage.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Data Centers and Hosting Services sector
data_center_tickers = ['EQIX', 'DLR', 'CONE']  # Equinix, Digital Realty Trust, CyrusOne

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in data_center_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Data Centers and Hosting Services Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

E-commerce

The buying and selling of goods and services over the internet, and the transfer of money and data to execute these transactions.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the E-commerce sector
ecommerce_tickers = ['AMZN', 'EBAY', 'SHOP']  # Amazon, eBay, Shopify

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in ecommerce_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of E-commerce Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Environmental Services and Equipment

Offers services and equipment to help businesses and consumers preserve the environment, including waste management and recycling.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Environmental Services and Equipment sector
environmental_tickers = ['WM', 'RSG', 'CLH']  # Waste Management, Republic Services, Clean Harbors

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in environmental_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Environmental Services and Equipment Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Executive and Legislative Offices, Combined

Governmental sector that includes the executive and legislative branches responsible for policy-making and governance.

No Data available

Facility Services

Manages and maintains buildings and grounds, ensuring they are safe and efficient.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Facility Services sector
facility_services_tickers = ['ABM', 'ROL']  # ABM Industries, Rollins

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in facility_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Facility Services Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Farming (Crop Production)

The cultivation of crops for food, fuel, feed, and fiber.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbol for a company in the Farming (Crop Production) sector
farming_ticker = 'DE'  # Deere & Company

# Get historical data for this ticker
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for the ticker
plt.figure(figsize=(14, 7))

data = yf.download(farming_ticker, start=start_date, end=end_date)
plt.plot(data['Close'], label=f'{farming_ticker} Closing Price')

plt.title('Closing Price of Deere & Company')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Fintech

Financial technology used to support and enable banking and financial services, leveraging software, mobile devices, and cloud services to make financial operations more efficient.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for a selection of Fintech companies
fintech_tickers = ['SQ', 'PYPL', 'HOOD', 'AFRM']  # Block (formerly Square), PayPal, Robinhood, Affirm

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in fintech_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data.index, data['Close'], label=f'{ticker}')

plt.title('Closing Price of Fintech Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Freight and Cargo Transportation

The movement of goods by land, sea, or air, including logistics and supply chain management.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Freight and Cargo Transportation sector
freight_tickers = ['FDX', 'UPS', 'JBHT']  # FedEx, UPS, J.B. Hunt

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in freight_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Freight and Cargo Transportation Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Furniture

Design, manufacture, and sale of office, home, and institutional furniture and related products.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Furniture sector
furniture_tickers = ['MLHR', 'SCS', 'LZB']  # Herman Miller, Steelcase, La-Z-Boy

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in furniture_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Furniture Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Heavy Electrical Equipment

Production of heavy electrical machinery like generators, transformers, and turbines used in power generation and industrial processes.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Heavy Electrical Equipment sector
heavy_electrical_tickers = ['GE', 'ETN', 'EMR']  # General Electric, Eaton, Emerson Electric

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in heavy_electrical_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Heavy Electrical Equipment Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Homebuilding

The construction and sale of residential buildings, from single-family homes to multi-unit dwellings.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Homebuilding sector
homebuilding_tickers = ['DHI', 'LEN', 'PHM']  # D.R. Horton, Lennar Corporation, PulteGroup

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in homebuilding_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Homebuilding Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Industrial Conglomerates

Large corporations that own companies in multiple industries, often with a diverse range of products and services.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Industrial Conglomerates sector
conglomerate_tickers = ['MMM', 'HON', 'GE']  # 3M, Honeywell, General Electric

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in conglomerate_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Industrial Conglomerates')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Infrastructure Operations

Companies that manage and operate essential public services and facilities, such as roads, bridges, and water supply systems.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Infrastructure Operations sector
infrastructure_tickers = ['J', 'ACM', 'PWR']  # Jacobs Engineering, AECOM, Quanta Services

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in infrastructure_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Infrastructure Operations Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

IT Services

Provides expertise in technology, offering solutions like network management, technical support, and IT consulting.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the IT Services sector
it_services_tickers = ['IBM', 'ACN', 'CTSH']  # IBM, Accenture, Cognizant

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in it_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of IT Services Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Jewelry and Watchmaking

The design, production, and retail of jewelry and watches, ranging from mass-market to luxury items.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Jewelry and Watchmaking sector
jewelry_tickers = ['SIG', 'MOV']  # Signet Jewelers, Movado Group

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in jewelry_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Jewelry and Watchmaking Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Legal Services

Firms that offer legal representation, advice, and other law-related services to individuals and businesses.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies related to the Legal Services sector
legal_services_tickers = ['LZ', 'VRSK']  # LegalZoom, Verisk Analytics

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in legal_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Companies Related to Legal Services')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Marine Ports and Services

Management and operation of sea ports and related services, including cargo handling and logistics.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies related to the Legal Services sector
legal_services_tickers = ['LZ', 'VRSK']  # LegalZoom, Verisk Analytics

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in legal_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Companies Related to Legal Services')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Marketing and Advertising

Agencies and companies that create, plan, and handle marketing and advertising for clients.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Marketing and Advertising sector
marketing_tickers = ['IPG', 'OMC', 'TTD']  # Interpublic Group, Omnicom Group, The Trade Desk

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in marketing_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Marketing and Advertising Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Medical Devices

Design and manufacture of devices used to diagnose, prevent, monitor, treat, or alleviate health conditions.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Medical Devices sector
medical_devices_tickers = ['MDT', 'ABT', 'BSX']  # Medtronic, Abbott Laboratories, Boston Scientific

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in medical_devices_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Medical Devices Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Medical Equipment and Supplies Manufacturing

Production of equipment and supplies for healthcare providers, including surgical instruments and medical appliances.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Medical Equipment and Supplies Manufacturing sector
medical_supplies_tickers = ['BDX', 'SYK', 'BAX']  # Becton Dickinson, Stryker, Baxter International

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in medical_supplies_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Medical Equipment and Supplies Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Motion Picture and Video Industries

Encompasses the production, distribution, and exhibition of films and videos.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Motion Picture and Video Industries sector
movie_industry_tickers = ['NFLX', 'DIS', 'WBD']  # Netflix, Disney, Warner Bros. Discovery

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in movie_industry_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Motion Picture and Video Industries Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Nanotechnology

The manipulation of matter on an atomic, molecular, and supramolecular scale, often used for materials science and electronics.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies involved in the Nanotechnology sector
nanotech_tickers = ['TMO', 'AMAT']  # Thermo Fisher Scientific, Applied Materials

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in nanotech_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Nanotechnology-Related Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Natural Gas Distribution

The transportation of natural gas from producers to consumers, including the infrastructure and services needed for its delivery.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Natural Gas Distribution sector
natural_gas_tickers = ['WMB', 'KMI', 'D']  # Williams Companies, Kinder Morgan, Dominion Energy

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in natural_gas_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Natural Gas Distribution Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Non-Metallic Mineral Product Manufacturing

Involves the production of goods such as glass, ceramics, and cement from non-metallic minerals.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Non-Metallic Mineral Product Manufacturing sector
non_metallic_mineral_tickers = ['VMC', 'MLM', 'OC']  # Vulcan Materials, Martin Marietta Materials, Owens Corning

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in non_metallic_mineral_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Non-Metallic Mineral Product Manufacturing Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Nursing and Residential Care Facilities

Provide residential care combined with either nursing, supervisory, or other types of care as required by the residents.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Nursing and Residential Care Facilities sector
nursing_care_tickers = ['BKD', 'ENSG', 'GEN']  # Brookdale Senior Living, Ensign Group, Genesis HealthCare

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in nursing_care_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Nursing and Residential Care Facilities Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Office Electronics

The production and sale of office-related electronics like printers, copiers, and shredders.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Office Electronics sector
office_electronics_tickers = ['XRX', 'HPQ', 'CAJ']  # Xerox, HP, Canon

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in office_electronics_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Office Electronics Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Oil and Gas Equipment and Services

Supplies the technology and services needed for the exploration, extraction, and production of oil and gas.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Oil and Gas Equipment and Services sector
oil_gas_services_tickers = ['SLB', 'HAL', 'BKR']  # Schlumberger, Halliburton, Baker Hughes

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in oil_gas_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Oil and Gas Equipment and Services Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Oil and Gas Refining and Marketing

Involves the processing of crude oil and raw natural gas into marketable products, and their distribution to consumers.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Oil and Gas Refining and Marketing sector
refining_marketing_tickers = ['VLO', 'MPC', 'PSX']  # Valero Energy, Marathon Petroleum, Phillips 66

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in refining_marketing_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Oil and Gas Refining and Marketing Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Online Media

Digital content and services that are delivered over the internet, including news, music, and video streaming.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Online Media sector
online_media_tickers = ['GOOGL', 'FB', 'TWTR']  # Alphabet, Meta Platforms, Twitter

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in online_media_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Online Media Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Outsourcing and Offshoring

Contracting out of business processes to third-party providers, often in other countries to reduce costs.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Outsourcing and Offshoring sector
outsourcing_tickers = ['ACN', 'ADP', 'CTSH']  # Accenture, Automatic Data Processing, Cognizant

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in outsourcing_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Outsourcing and Offshoring Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Packaging and Containers

The production of packaging and containers to protect, transport, and display products.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Packaging and Containers sector
packaging_tickers = ['IP', 'WRK', 'BALL']  # International Paper, WestRock, Ball Corporation

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in packaging_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Packaging and Containers Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Paints, Coatings, and Adhesives

Manufacturing of products used to finish and protect surfaces, including decorative and industrial paints.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Paints, Coatings, and Adhesives sector
paints_coatings_tickers = ['SHW', 'PPG', 'RPM']  # Sherwin-Williams, PPG Industries, RPM International

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in paints_coatings_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Paints, Coatings, and Adhesives Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Paper and Forest Products

Involves the production of paper goods and the management and harvesting of forest resources for lumber and other products.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Paper and Forest Products sector
paper_forest_tickers = ['IP', 'WRK', 'WY']  # International Paper, WestRock, Weyerhaeuser

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in paper_forest_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Paper and Forest Products Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Personal Services

Services provided to individuals, such as personal care, photography, and housekeeping.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Personal Services sector
personal_services_tickers = ['WW', 'SCI', 'HRB']  # Weight Watchers, Service Corporation International, H&R Block

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in personal_services_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Personal Services Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Pesticide, Fertilizer, and Other Agricultural Chemical Manufacturing

Production of chemicals used in agriculture to enhance growth and protect crops.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Pesticide, Fertilizer, and Other Agricultural Chemical sector
ag_chemical_tickers = ['NTR', 'MOS', 'CTVA']  # Nutrien, Mosaic Company, Corteva

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in ag_chemical_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Agricultural Chemical Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Petroleum and Coal Products Manufacturing

Processing of petroleum and coal into usable products, including fuel and petrochemicals.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Petroleum and Coal Products Manufacturing sector
petroleum_coal_tickers = ['XOM', 'CVX', 'PSX']  # Exxon Mobil, Chevron, Phillips 66

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in petroleum_coal_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Petroleum and Coal Products Manufacturing Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()

Plastics and Rubber Products Manufacturing

Production of goods from plastics and rubber, ranging from packaging to automotive parts.

import yfinance as yf
import matplotlib.pyplot as plt

# Define the ticker symbols for companies in the Plastics and Rubber Products Manufacturing sector
plastics_rubber_tickers = ['NWL', 'GT']  # Newell Brands, Goodyear Tire & Rubber

# Get historical data for these tickers
start_date = '2022-01-01'
end_date = '2023-01-01'

# Plot the closing prices for each ticker
plt.figure(figsize=(14, 7))

for ticker in plastics_rubber_tickers:
    data = yf.download(ticker, start=start_date, end=end_date)
    plt.plot(data['Close'], label=f'{ticker} Closing Price')

plt.title('Closing Price of Plastics and Rubber Products Manufacturing Companies')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.legend()
plt.grid(True)
plt.show()