📋 Overview

What You'll Learn: How to use VS Code with Jupyter Notebooks for ClydeEnergy data science and development workflows.

🎯 Learning Objectives

By the end of this guide, ClydeEnergy team members will be able to:

  • Install and configure VS Code for Jupyter development
  • Create and manage Jupyter notebooks in VS Code
  • Execute Python code in interactive cells
  • Combine code, markdown, and visualizations
  • Debug notebook code effectively
  • Use advanced features for professional development

🛠️ Technology Stack

  • Editor: Visual Studio Code
  • Extensions: Jupyter, Python
  • Language: Python 3.8+
  • Notebook: Jupyter (.ipynb files)
  • Libraries: pandas, matplotlib, numpy

🔧 Install Required Extensions

1

Install Jupyter Extension

VS Code Extensions
# ClydeEnergy VS Code Setup Steps:
# 1. Press Ctrl+Shift+X (or Cmd+Shift+X on Mac)
# 2. Search for "Jupyter"
# 3. Install the official Jupyter extension by Microsoft
# 4. This enables native Jupyter notebook support
2

Install Python Extension

Python Extension
# ClydeEnergy Python Extension:
# 1. Search for "Python" in VS Code Extensions
# 2. Install the official Python extension by Microsoft
# 3. Provides IntelliSense and debugging support
# 4. Essential for ClydeEnergy development workflow
💡 ClydeEnergy Tip: If this is your first time installing the Jupyter extension, you'll see a welcome experience that walks you through creating your first notebook.

⚙️ Setup Environment

1

Check Python Installation

Terminal
# ClydeEnergy Python Environment Check
python --version
# or
python3 --version

# Expected: Python 3.8+ for ClydeEnergy projects
2

Create Virtual Environment

Virtual Environment Setup
# Create ClydeEnergy virtual environment
python -m venv clydeenergy_jupyter

# Activate on Windows
clydeenergy_jupyter\Scripts\activate

# Activate on macOS/Linux
source clydeenergy_jupyter/bin/activate

# Install essential packages for ClydeEnergy
pip install jupyter pandas numpy matplotlib seaborn
⚠️ ClydeEnergy Note: Always use virtual environments to avoid package conflicts between different projects.

📓 Create Your First Notebook

1

Create New Notebook

Notebook Creation Methods
# ClydeEnergy Notebook Creation:
# Method 1: Command Palette
# Press Ctrl+Shift+P → Type "Create: New Jupyter Notebook"

# Method 2: File Menu
# File → New File → Jupyter Notebook

# Method 3: File Explorer
# Right-click → New File → name.ipynb
2

ClydeEnergy Naming Convention

File Naming Standards
# ClydeEnergy Naming Convention:
# Format: YYYY-MM-DD_ClydeEnergy_ProjectType_Description.ipynb

# Examples:
# 2025-08-03_ClydeEnergy_DataAnalysis_EnergyMetrics.ipynb
# 2025-08-03_ClydeEnergy_MachineLearning_Forecasting.ipynb
# 2025-08-03_ClydeEnergy_Visualization_Dashboard.ipynb
📁 ClydeEnergy Organization: Use descriptive names that include date, project type, and purpose for better team collaboration.

🔌 Connect to Kernel

1

Select ClydeEnergy Kernel

Kernel Connection
# ClydeEnergy Kernel Connection Steps:
# 1. Click "Select Kernel" in top-right of notebook
# 2. Choose "Python Environment" from dropdown
# 3. Select your ClydeEnergy virtual environment
# 4. Wait for kernel to initialize
2

Verify Connection

Python Test
# ClydeEnergy Kernel Verification
import sys
import datetime

print("🏢 ClydeEnergy Development Environment")
print(f"🐍 Python: {sys.version}")
print(f"📅 Time: {datetime.datetime.now()}")
print("✅ Kernel connected successfully!")
💡 ClydeEnergy Tip: Always use your ClydeEnergy virtual environment to ensure consistent package versions across the team.

▶️ Run Code Cells

1

Basic Cell Execution

ClydeEnergy Example
# ClydeEnergy Hello World
print("🏢 Hello from ClydeEnergy!")
print("🚀 Welcome to VS Code Jupyter Notebooks")

# ClydeEnergy metrics example
efficiency = 95.5
savings = 150000
print(f"⚡ Efficiency: {efficiency}%")
print(f"💰 Savings: ${savings:,}")
2

Execution Methods

ClydeEnergy Execution Options
# ClydeEnergy Execution Methods:
# 1. Single cell: Ctrl+Alt+Enter or play button
# 2. Run all: Click "Run All" in toolbar
# 3. Run above: Right-click → "Execute Cells Above"
# 4. Run below: Right-click → "Execute Cells Below"
# 5. Run selection: Highlight code → F8
📊 ClydeEnergy Workflow: Use "Run All" to ensure all data dependencies are loaded before generating reports.

📝 Text, Code, and Visuals

1

ClydeEnergy Markdown Documentation

Markdown Example
# ClydeEnergy Analysis Report

## Executive Summary
Energy efficiency analysis for Q3 2025.

### Key Findings:
- **Energy Savings**: 25% improvement
- **Cost Reduction**: $150,000 annually
- **ROI Timeline**: 18 months

### ClydeEnergy Recommendations:
1. Implement Phase 2 upgrades
2. Expand to international facilities
3. Develop predictive models
2

Data Visualization

ClydeEnergy Visualization
# ClydeEnergy Data Analysis
import pandas as pd
import matplotlib.pyplot as plt

# Sample ClydeEnergy data
data = {
    'Product': ['Solar Panel', 'Wind Turbine', 'Battery'],
    'Efficiency': [95.5, 98.2, 96.8],
    'Cost': [25000, 45000, 15000]
}

df = pd.DataFrame(data)
print("📊 ClydeEnergy Product Analysis:")
print(df)

# Create visualization
plt.figure(figsize=(10, 6))
plt.bar(df['Product'], df['Efficiency'])
plt.title('ClydeEnergy: Product Efficiency')
plt.ylabel('Efficiency (%)')
plt.show()
💡 ClydeEnergy Tip: Combine data tables, calculations, and visualizations to create comprehensive reports for stakeholders.

🐛 Debugging Options

1

Line-by-Line Debugging

ClydeEnergy Debug Example
# ClydeEnergy Energy Calculation
def calculate_savings(usage, efficiency):
    """Calculate energy savings for ClydeEnergy"""
    baseline = usage
    optimized = usage * (1 - efficiency/100)
    savings = baseline - optimized
    return savings, optimized

# Test with ClydeEnergy data
current_usage = 10000  # kWh
improvement = 25  # 25% efficiency gain

savings, new_usage = calculate_savings(current_usage, improvement)
print(f"🔋 Current: {current_usage} kWh")
print(f"⚡ New: {new_usage:.0f} kWh")
print(f"💚 Savings: {savings:.0f} kWh")
2

Breakpoint Debugging

Advanced Debugging
# ClydeEnergy ROI Calculation
def calculate_roi(investment, monthly_savings, years=5):
    """Calculate ROI for ClydeEnergy projects"""
    annual_savings = monthly_savings * 12
    total_savings = annual_savings * years
    
    # Set breakpoint here to inspect variables
    roi = ((total_savings - investment) / investment) * 100
    payback = investment / annual_savings
    
    return roi, payback

# ClydeEnergy example
roi, payback = calculate_roi(50000, 2500)
print(f"📈 ROI: {roi:.1f}%")
print(f"⏳ Payback: {payback:.1f} years")
⚠️ ClydeEnergy Debug: Right-click in a cell and select "Debug Cell" to step through code line by line.

🚀 Advanced Features

1

Variable Explorer

ClydeEnergy Variables
# ClydeEnergy Advanced Analysis
import pandas as pd
import numpy as np

# Generate ClydeEnergy dataset
np.random.seed(42)
dates = pd.date_range('2025-01-01', periods=365)
energy_data = {
    'date': dates,
    'solar': np.random.normal(850, 150, 365),
    'wind': np.random.normal(620, 200, 365),
    'consumption': np.random.normal(1200, 100, 365)
}

clydeenergy_df = pd.DataFrame(energy_data)
clydeenergy_df['net_generation'] = clydeenergy_df['solar'] + clydeenergy_df['wind']
clydeenergy_df['balance'] = clydeenergy_df['net_generation'] - clydeenergy_df['consumption']

print("🔋 ClydeEnergy Annual Summary:")
print(f"☀️ Solar: {clydeenergy_df['solar'].sum():,.0f} kWh")
print(f"💨 Wind: {clydeenergy_df['wind'].sum():,.0f} kWh")
print(f"⚡ Consumption: {clydeenergy_df['consumption'].sum():,.0f} kWh")
2

Data Wrangler Integration

Advanced Data Tools
# ClydeEnergy Data Wrangler Usage:
# 1. Click "Variables" in notebook toolbar
# 2. Find 'clydeenergy_df' in the variable list
# 3. Click the data viewer icon
# 4. Install Data Wrangler extension if prompted

# Sample operations you can do:
monthly_summary = clydeenergy_df.groupby(clydeenergy_df['date'].dt.month).agg({
    'solar': 'mean',
    'wind': 'mean',
    'consumption': 'mean'
}).round(2)

print("📅 ClydeEnergy Monthly Analysis:")
print(monthly_summary.head())
🔍 ClydeEnergy Advanced: Click "Variables" in the notebook toolbar to see all variables. DataFrames can be opened in a custom editor for detailed inspection.