Skip to content
Experiment with the AI assistant
  • AI Chat
  • Code
  • Report
  • Spinner

    Experiment with the AI assistant

    Generative AI is coming to DataCamp Workspace! Go through this notebook to experience the AI-enabled functionality. In this example project, we'll be downloading and visualization financial data.

    Get the data

    The first step is getting data. Try asking the AI Assistant to "import yahoo finance data" for any publicly-traded company.

    # Import the necessary libraries
    import yfinance as yf
    import pandas as pd
    
    # Define the ticker symbol
    ticker = 'AAPL'
    
    # Download the data
    data = yf.download(ticker, start='2020-01-01', end='2021-01-01')
    
    # Display the data
    data.head()

    Visualize the data

    After the data has been imported, visualize the data by using the prompt "Plot the stock value over time."

    Do more

    Some ideas:

    • Analyze the performance of the stock you selected in comparison to another stock throughout the pandemic. Generate a chart that showcases the values of "Stock A" and "Stock B" from 2019 to the present.
    • Plot the revenue and earnings of stock A and stock B.
    • Compare the market cap of the 5 largest companies in a sector you're interested in.

    May the AI force be with you! 🤖