Academy / Data & Machine Learning

Path 2 · Course 1 · For beginners

Python for AI

Python from scratch with an AI focus, with code you can run and edit right on the page: variables, lists and dictionaries, functions, files and JSON, pandas for data, calling AI model APIs safely, and a hands-on project analysing customer reviews with AI.

By · Last updated

6 modulesAbout 5.5 hoursKnowledge check per moduleFinal assessment & certificateNo prerequisites

0 of 6 modules complete

Modules

  1. 1

    Getting started with Python

    Why Python for AI, running code in your browser, variables and types, strings and f-strings, reading errors, and coding with AI assistants, rounding and formatting numbers, and a method for debugging.

    40 min
  2. 2

    Data structures, logic and functions

    Lists, dictionaries, conditions, loops, list comprehensions and functions, lists of dictionaries, counting and grouping, and functions with defaults.

    45 min
  3. 3

    Files, text and JSON

    Reading and writing files, JSON for AI APIs, try/except, cleaning text with regular expressions, and CSV files, nested JSON, building prompts from data, and JSON Lines.

    45 min
  4. 4

    Working with data in pandas

    DataFrames, inspecting data, selecting and filtering, missing values, new columns, grouping, charts and saving results, dates, joining tables with merge, and reading chained steps.

    50 min
  5. 5

    Calling AI model APIs

    How AI APIs work, keeping keys secret, a first API call, a helper function, structured output with a schema, tool use and MCP, and handling errors, limits and cost, tracking cost, caching answers, and how conversations are sent.

    55 min
  6. 6

    Project: analysing reviews with AI

    An end-to-end project: a review dataset, AI classification, checking the AI's work, summarising for a manager, and good habits for growing projects, and a second project turning the analysis into a script that writes a weekly report.

    55 min

Frequently asked questions

Can I learn Python for AI with no programming experience?

Yes. Python for AI starts from scratch, and every code example is a live cell you can run and edit in your browser, so there's nothing to install. Module 1: Getting started with Python →

Why is Python used for AI?

Python is readable, beginner-friendly, and has the libraries AI work relies on, such as pandas for data and the official SDKs for AI model APIs. Module 1: Getting started with Python →

How do I call an AI model API from Python?

Install the provider's library, keep your API key in a secret rather than in your code, send a request with your prompt, and handle errors, rate limits and cost. The course builds a reusable helper function. Module 5: Calling AI model APIs →

What is pandas used for?

pandas is the Python library for working with tables of data: loading, inspecting, filtering, cleaning, grouping, charting and saving results. Module 4: Working with data in pandas →

What will I build in the course?

An end-to-end project that uses AI to classify customer reviews, checks the AI's work, and summarises the findings for a manager. Module 6: Project: analysing reviews with AI →