This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import necessary libraries | |
import quandl | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Set your Quandl API key (you need to sign up on Quandl's website to get your API key) | |
quandl.ApiConfig.api_key = 'YOUR_API_KEY' | |
# Define the dataset codes for Google and Yahoo | |
google_dataset = 'WIKI/GOOGL' # Replace with the correct dataset code for Google |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import necessary libraries | |
import quandl | |
import matplotlib.pyplot as plt | |
# Set your Quandl API key (you need to sign up on Quandl's website to get your API key) | |
quandl.ApiConfig.api_key = 'YOUR_API_KEY' | |
# Define the dataset codes for the BRICS nations' GDP | |
brics_gdp_datasets = { | |
'Brazil': 'ODA/BRA_NGDPD', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yfinance as yf | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Define a list of stock tickers for the portfolio | |
tickers = ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'TSLA'] | |
# Set the date range for historical data | |
start_date = '2010-01-01' |
OlderNewer