Untitled Python workspace
  • AI Chat
  • Code
  • Report
  • Beta
    Spinner
    # Importing necessary libraries
    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt
    import plotly.express as px
    import yfinance as yf
    from datetime import datetime
    
    # Define the list of consumer technology companies
    companies = ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'FB']
    
    # Define the start and end dates for the data
    start_date = '2010-01-01'
    end_date = datetime.today().strftime('%Y-%m-%d')
    
    # Download the stock data for the companies
    data = yf.download(companies, start=start_date, end=end_date)
    
    # Plot the stock prices
    fig = px.line(data, x=data.index, y='Close', title='Stock Prices of Consumer Technology Companies')
    fig.show()