Session 0: Technical Setup & Environment Configuration#

Learning Outcomes: By the end of this session, you will be able to:

  • Set up a complete Python environment for financial analysis

  • Install essential Python libraries for finance (pandas, numpy, matplotlib, yfinance)

  • Verify that your technical environment is properly configured

Prerequisites:

  • Basic computer literacy (web browsing, file management)

  • No prior programming experience required


Development Environment Setup#

Option 2: Local IDE Setup (WindSurf or VS Code)#

  1. Install Python First:

    • Download Python from python.org

    • Important: During installation, check “Add Python to PATH”

    • Verify installation by opening a terminal/command prompt and typing: python --version

  2. Download and Install IDE:

  3. Create Project Folder:

    • Open the IDE

    • Create new folder: “Finance_Analytics_Course”

    • Open this folder as your workspace

  4. Install Python Extension:

    • Open Extensions panel

    • Search “Python” and install official extension

    • Restart the IDE


Essential Libraries Setup#

For Google Colab Users:#

# While Colab has many libraries pre-installed, we'll explicitly install
# the versions we need to ensure consistency
!pip install pandas numpy matplotlib yfinance

For Local IDE Users:#

# Install required packages
!pip install pandas numpy matplotlib yfinance

Library Verification Test#

Run this code to verify that all required libraries are properly installed and functioning:

# Essential Library Test
try:
    import pandas as pd
    print("✅ pandas successfully imported")
except ImportError:
    print("❌ pandas import failed")

try:
    import numpy as np
    print("✅ numpy successfully imported")
except ImportError:
    print("❌ numpy import failed")

try:
    import matplotlib.pyplot as plt
    print("✅ matplotlib successfully imported")
except ImportError:
    print("❌ matplotlib import failed")

try:
    import yfinance as yf
    print("✅ yfinance successfully imported")
except ImportError:
    print("❌ yfinance import failed")

# Test market data access
try:
    # Use major ETF for reliable data
    test_data = yf.download('SPY', period='5d', progress=False)
    if not test_data.empty:
        print("✅ Market data access working")
    else:
        print("⚠️ No data returned - check internet connection")
except Exception as e:
    print(f"❌ Connection error: {str(e)[:50]}...")
    print("💡 Try again later or use sample data for learning")

Troubleshooting Common Issues#

Package Installation Problems#

Issue: ModuleNotFoundError: No module named 'package_name'

Solution:

# Try installing the package again
!pip install package_name

# If using a local environment, try:
# pip install package_name --user

AI Prompt for Help:

I'm a finance student setting up my Python environment for financial data analysis.
I'm getting this error when trying to import [package_name]: [paste exact error]

I'm using [Google Colab/WindSurf/VS Code].
What steps should I take to fix this issue?

Connection Issues#

Issue: Cannot download market data

Solution:

  • Check your internet connection

  • Verify that you’re using correct ticker symbols

  • Try using a different data source or time period

AI Prompt for Help:

I'm trying to download financial data using yfinance in my [Google Colab/WindSurf/VS Code] environment.
I'm getting this error: [paste exact error]

Here's my code:
[paste your code]

How can I fix this issue and successfully download the market data?

IDE-Specific Issues#

Google Colab:

  • If cells are not running, try “Runtime” → “Restart runtime”

  • For permission issues, check that you’re signed into your Google account

Local IDE:

  • Ensure Python is in your system PATH

  • Try creating a new virtual environment

AI Prompt for Help:

I'm a finance student setting up my Python environment for financial data analysis.
I'm having trouble with my [Google Colab/WindSurf/VS Code] environment.

Specifically, I'm experiencing this issue: [describe your issue]

Here's what I've tried so far: [describe what you've attempted]

Can you help me troubleshoot this problem?

Getting Help#

If you encounter issues, use these resources:

  1. Documentation:

  2. Course Resources:

    • Check the course materials for specific setup guides

    • Ask classmates who have successfully completed setup


Project Organization#

Create a simple folder structure for your course work:

Finance_Analytics_Course/
├── Session_0_Setup/
├── Session_1_Total_Return/
├── Session_2_Data_Collection/
├── Data/
└── Documentation/

Ready for Session 1?#

You’re ready for Session 1 when you can:

  • ✅ Run Python code successfully in your chosen environment

  • ✅ Import and use essential financial libraries (pandas, numpy, matplotlib, yfinance)

  • ✅ Access and process basic market data