Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 3.68 KB

File metadata and controls

43 lines (32 loc) · 3.68 KB

Setup guide: before Lesson 1

1. Do you have Python in Excel?

Open Excel, click the Formulas tab, and look for a Python group (Insert Python, Initialization, Python Editor). If it's there, you're set. If not, work through the checklist below.

Requirement What to check
Subscription Microsoft 365 (Business/Enterprise, or Family/Personal). Python in Excel is not in perpetual-licence Excel (2019/2021/2024).
Excel build Windows: Current Channel or Monthly Enterprise Channel version 2408+; Semi-Annual Enterprise Channel 2502+. Also available in Excel for the web. Mac support is rolling out: check the availability page.
Compute Standard compute is included; a paid Python in Excel add-on buys premium (faster) compute. You do not need the add-on for this course.
Network Code runs in Microsoft's cloud, not on your PC. Corporate tenants can disable it: if you see the ribbon group but formulas return errors, ask IT.

Official references: Introduction to Python in Excel · Get started · Add-on licensing FAQ

2. Three ways to start a Python cell

  1. Formulas → Insert Python
  2. Type =PY( in any cell
  3. Ctrl+Alt+Shift+P

Press Ctrl+Enter to run (plain Enter runs too but moves selection). Esc backs out of a half-typed cell.

3. Shortcuts you'll use constantly

Keys Does
Ctrl+Alt+Shift+P Insert Python cell
Ctrl+Enter Commit/run
Ctrl+Alt+Shift+M Toggle Python Object ↔ Excel Value (spill DataFrames, render charts)
Ctrl+Alt+Shift+F Toggle full/partial calc mode

Full list: Python in Excel keyboard shortcuts

4. What's already imported (don't import pandas again)

Formulas → Python → Initialization shows the defaults: numpy as np, pandas as pd, matplotlib.pyplot as plt, seaborn as sns, statsmodels as sm. Everything else (SciPy, scikit-learn, NLTK…) is installed but must be imported in your cell. Which libraries exist: Open-source libraries and Python in Excel · Initialization settings

5. Two habits that prevent 80% of the confusion

  • Put data in an Excel Table (Ctrl+T) before pointing Python at it. xl("table_name[#All]", headers=True) is the pattern for the whole course.
  • Python runs top-to-bottom, left-to-right across the workbook. A cell can only see objects defined above/left of it. If you get #PYTHON! when referencing a variable, that's usually why.

6. When something goes wrong

Troubleshoot Python in Excel errors covers #PYTHON!, #BUSY!, #CONNECT!, #BLOCKED!, #TIMEOUT!. The Python Editor pane shows the full error text and traceback.

7. Course files

Download the course zip and keep the folder structure. Every module has a starter.xlsx (open this) and a solution.xlsx (finished state). Never overwrite the starter: Save As with your name.