Economics, Python and AI: Skills for Analytics Work

Eric Van Dusen

2026-11-23

Economics, Python and AI: Skills for Analytics Work

Data 88E, Econ 148 and learning to work with models

Plan for today

Economics in notebooks

Data 8, Data 88E and Econ 148 at Berkeley

Skills for jobs in the AI era

What keeps its value when AI writes code

Step one: vibecoding

Building analyses with an AI assistant, and checking them

Step two: small models

The harness that sits around every AI product

Part 1

Economics in notebooks

My path into notebooks

  • My background is in international development
  • At Berkeley I started teaching a development course built on notebooks
  • Students worked with field data from published studies in the first week
  • That course led to Data 88E and Econ 148

Charts from development field data, outcomes by treatment arm and diarrhea prevalence by survey round, with a photo of a community water source

Data 8: Foundations of Data Science

  • Introductory course open to students in any major
  • No prerequisites in programming or statistics
  • Real questions and real data from the first lecture
  • Python introduced as students need it, inside notebooks

Computational and Inferential Thinking, the open Data 8 textbook

Open textbook: Adhikari, DeNero and Wagner, Computational and Inferential Thinking, inferentialthinking.com

The Data Science Connectors model

  • Connector courses are taken alongside Data 8
  • Each one applies the same tools to a single discipline
  • Faculty in that discipline design and teach them
  • Students see the methods used on questions from their own field

Connectors Library listing course notebook repositories: Child Development in the Developing World, City Planning, Civil Engineering, Cognitive Science, Data 88 Economic Models, Genetics and Genomics, Demography

Connectors Library: public notebook repositories for connector courses

Data 88E: Economic Models

  • A connector course in economics
  • Economic models taught through notebooks
  • Students work with economic data alongside the theory
  • Open materials that other institutions have adapted

Data 88E Economic Models Textbook page showing an interactive 3D plot of a Cobb-Douglas utility function with a budget constraint

Data 88E: Economic Models Textbook, Budget Constraints and Utility Maximization. data-88e.github.io/textbook

From a spreadsheet to a demand curve

  • Survey in a spreadsheet
  • Table in a notebook
  • Demand curve
  • Students answer a willingness-to-pay survey in Google Sheets
  • The same data is read into a notebook with one line of code
  • The class demand curve is plotted from their own answers
Class demand survey responses in a Google Sheet, the same data read into a table in a notebook, and the resulting demand curve of price against cumulative count with a best-fit line

Data 88E, fall 2024: class demand survey in a spreadsheet, read into a notebook, plotted as a demand curve

Econ 148: Data Science for Economists

Forecasting

ARIMA, Prophet and Chronos-2 on Zillow rent and CPI data

ML fairness

Income prediction on Folktables and ACS data, with SHAP explanations

Survival analysis

Time to reemployment for displaced workers, IPUMS CPS data with lifelines

Each unit puts a classic econometric method next to a newer model on the same data.

Frequent assessment in Econ 148

  • Students practice pandas code on PrairieLearn
  • Questions are randomized and graded automatically
  • Feedback arrives right away, while students are still working on the problem

PrairieLearn question from Econ 148, Spring 2026: fill in the blanks in pandas code

prairielearn.com. Question from Econ 148, Spring 2026.

The Python stack

  • Read the docs
  • Supply data
  • Configure
  • Run
  • Interpret
  • Econ 148 students meet a new data or ML package every few weeks
    • NumPy, pandas, statsmodels, scikit-learn
  • The same stack runs in Colab, Databricks and JupyterHub
  • AI tools expose similar Python interfaces, and the same pattern applies

Jupyter NumPy pandas scikit-learn PyTorch Databricks

Part 2

Skills for jobs in the AI era

What changes when AI writes code

Daily Californian article: AI use leads UC Berkeley math professor to see no point in grading homework

Richard Borcherds, a Fields medalist on the Berkeley mathematics faculty, no longer grades homework for correctness.

  • Many of his students were using AI to receive top homework scores
  • AI tools can now do much of the routine work in a course, and in many jobs

If AI can produce the routine answers, what is left for you to learn?

Audrey Baime, The Daily Californian, October 23, 2026

Skills that keep their value

Read and write Python

AI tools produce code that you have to check.

Ask an inferential question

Is the goal prediction, or cause and effect?

Debug and test

AI-generated code often fails without an error message.

Know the domain

Economics or business knowledge is what makes a result meaningful.

Students who combine domain knowledge, data skills and working fluency with AI tools can build applications others cannot.

There is more analysis to do, not less

Terence Tao, Math 2.0, Caltech, October 2026

Terence Tao, “Math 2.0,” AIM Public Lecture, Caltech, October 2026

“The future frontiers of mathematics will always continue to expand.”

The same may hold for analytics:

  • Questions that took a semester project can now take a week
  • Smaller teams can work on more questions
  • More questions become feasible, in more fields

Part 3

Step one: vibecoding

What vibecoding means

Vibecoding is describing an analysis in natural language and having an AI assistant write the code. You then run it, read it and revise it.

  • Fast for a first draft
  • The analyst is still responsible for the result
  • Describe the question
  • Generate code
  • Run it
  • Read and check it
  • Revise

How do you know the code is right?

Exercise: can we reproduce this chart?

Spanish news graphic: headline says the labor market has gained 18 to 19 percent more workers while unemployment fell to its lowest since 2008; area chart of employed persons (EPA) and Social Security affiliates from 1996 to 2026, shaded by the terms of Aznar, Zapatero, Rajoy and Sánchez

  • A chart of employment in Spain by presidential term, published in the press
  • Two series: employed persons in the EPA survey and workers registered with Social Security
  • The task for an AI assistant: find the data, rebuild the chart and check the headline

The question is about data and careful reading, not about politics.

El Diario, Instagram post. instagram.com/p/DeXZ-VrGlI6

The result in a notebook

spain_economy_by_term.ipynb open in Google Colab, with a code cell that plots employment, and the resulting chart shaded by the terms of Aznar, Zapatero, Rajoy and Sánchez

  • The rebuilt chart, shaded by each Spanish president’s term
  • Runs in Google Colab with a Google account
  • Every step is in the notebook and can be checked

A larger example: the vibecession notebook

A notebook series built for students in Bogotá, October 2026, each running in Google Colab or JupyterLite.

  • Sources data from public APIs
  • Builds a monthly dataset
  • Compares consumer sentiment with economic fundamentals
  • Fits a time series model and examines the gap

Checking AI-written code with tests

  • Tests are written into the notebook
  • A test checks what the code returns, not what it is called
  • Here a function named square actually cubes its input
  • Tests are how you check vibecoded work

Notebook cell running grader.check on question 4: a function named square that cubes its input fails the test, which shows the test code and the expected value of 25 for square(5)

otter-grader: otter-grader.readthedocs.io

Part 4

Step two: small models and the harness

Small open models as teaching tools

A small open model runs on a laptop or in a browser, so students can inspect it directly.

  • Tokens and next-token probabilities
  • Temperature and other settings
  • The data that goes in and comes out
from transformers import AutoTokenizer
from transformers import AutoModelForCausalLM

name = "HuggingFaceTB/SmolLM2-135M"  # 270 MB
tok = AutoTokenizer.from_pretrained(name)
lm = AutoModelForCausalLM.from_pretrained(name)

prompt = "The stock market is"
ids = tok(prompt, return_tensors="pt")
probs = lm(**ids).logits[0, -1].softmax(-1)
for p, i in zip(*probs.topk(5)):
    print(tok.decode(i), f"{p:.0%}")

A small model in a notebook

Jupyter notebook loading a small Qwen model from a local file and generating text

A small Qwen model loaded on a JupyterHub. Students load it, change parameters and observe the results, with no setup.

  • Administrator: sets up the environment
  • Instructor: sets up the curriculum
  • Student: explores

What a harness is

Products like ChatGPT or Claude are a model plus a harness around it. A small model makes each layer visible.

  • Tokens: text becomes numbers
  • Chat format: system, user and assistant roles
  • System prompt and settings such as temperature
  • Context and memory: what the model sees each turn
  • Tools: letting the model call code or search
  • Evaluation: testing outputs for accuracy and bias

Small models in the browser

A JupyterLite site where small language models run in the student’s browser through WebLLM, with no server, API key or installation.

  • Talking to models and generation settings
  • Tokens, chunking and embeddings
  • Memory with SQLite and embedding search
  • Inside an open-weight model package

Requires Chrome or Edge with WebGPU.

A new course: Understanding AI with small models

Data 88I, a 2-unit connector course in development at Berkeley.

  • Runs in JupyterLite, on JupyterHub, or with students’ own Ollama installation
  • Topics: bias, evaluation, training data, privacy and API costs
  • Built on the same notebooks as the small-models-lite site

Where to start

1. Open a notebook

inferentialthinking.com

Read the Data 8 textbook, then open a notebook in Google Colab.

2. Rebuild a chart

QR code linking to the Colombia-26-NB notebook repository

Rebuild one chart with an AI assistant, and check the code.

3. Run a small model

QR code linking to the Small Models in the Browser site

Run a small model and look at its tokens.

4. Try AI in JupyterLite

QR code linking to the JupyterLite AI demo

An AI assistant inside a browser notebook.

Thank you

Eric Van Dusen
College of Computing, Data Science, and Society, UC Berkeley

ericvd@berkeley.edu · github.com/ericvd-ucb