Python for AI
Learn the Python tools most commonly used in AI, machine learning, and data analysis. NumPy, pandas, data cleaning, visualisation, and full ML project workflows.
What you'll learn
Python for AI is organized into 7 focused modules. By the end you'll be comfortable with:
- NumPy Fundamentals
- Pandas Fundamentals
- Data Cleaning
- Data Visualization
- Jupyter Notebooks
- AI Data Workflows
- Final Projects
Course curriculum
46 lessons across 7 modules. Lessons marked Free preview are readable without an account.
Module 1. NumPy Fundamentals
Arrays, dimensions, vector math, and numerical computing — the foundation of AI in Python
- 8mNumPy ArraysFree preview
Meet NumPy and the ndarray: one fixed-type block of numbers, why it's fast, and how to build one from a list.
- 8mCreating ArraysFree preview
Build arrays without typing every value: zeros, ones, full, arange, linspace, eye, and random.
- 10mArray Shapes and Dimensions
The dimensions lesson: axes, ndim, and reading .shape as a tuple, so 'expected 2D, got 1D' never scares you again.
- 9mReshaping Arrays
Rearrange the same numbers into a new grid with reshape, the -1 wildcard, flatten/ravel, and transpose.
- 9mIndexing and Slicing
Reach into arrays: 1D index/slice/step, 2D m[row, col], whole rows and columns, and the views-vs-copy gotcha.
- 9mVector OperationsFree preview
Do math on a whole array at once with vectorization, scalar broadcasting, and comparisons that build a boolean array.
- 9mAggregations and Axis
Boil an array down with sum/mean/std/min/max/median and argmax/argmin, then control the sweep direction on 2D arrays with the axis parameter.
- 9mBoolean Indexing
Use a boolean mask to select, count, and edit array elements; combine conditions with & and |, and branch with np.where.
- 8mPractice: NumPy
Mixed read-and-predict reps that combine everything from Module 1: create, reshape, slice, vectorize, aggregate along an axis, and mask.
Module 2. Pandas Fundamentals
Series, DataFrames, selecting, filtering, sorting, and grouping labelled data
- 9mSeries
The pandas Series: a 1D labelled array where every value carries an index label.
- 9mDataFrames
The DataFrame: a 2D labelled table made of Series that share one index.
- 9mExploring DataFrames
Load a CSV and run the first-look toolkit: head, tail, info, describe, shape, sample.
- 10mSelecting Data
Pick columns (Series vs DataFrame) and rows with loc (label) vs iloc (position).
- 10mFiltering and Sorting
Boolean filtering with & and |, isin, .str, query, and sort_values.
- 9mAggregations
Column aggregations and groupby: split-apply-combine for per-group answers.
- 10mGroupBy and Pivots
Multi-aggregation .agg, value_counts, pivot_table cross-tabs, and method chaining.
- 8mPractice: Pandas
Read-and-predict reps combining select, filter, sort, groupby, and value_counts.
Module 3. Data Cleaning
Missing values, type fixes, string cleaning, derived columns, and duplicates
- 9mMissing Values
What NaN is, why it's contagious, and how to find every hole with isna().
- 9mFilling Missing Values
Drop or fill? dropna, fillna with a constant/mean/median, ffill, and when to pick each.
- 9mData Transformations
Rename columns, fix dtypes with astype, parse dates with to_datetime, and the category dtype.
- 9mString Cleaning
The .str accessor: strip, lower/upper/title, replace, contains, split — so your groups stop fracturing.
- 9mApply and New Columns
Build columns with vectorized math and boolean logic, then apply() for per-value and per-row custom logic.
- 9mDuplicates and Reindexing
Find and drop duplicate rows, then clean up the gappy index with reset_index(drop=True).
- 9mPractice: Data Cleaning
No new concepts — walk one messy dataset end to end: detect, fill, retype, scrub, derive, dedupe, reindex.
Module 4. Data Visualization
Line, bar, scatter, histogram, box, and correlation charts with matplotlib and seaborn
- 9mCharts with Matplotlib
Meet matplotlib and the figure/axes model by building your first line chart.
- 9mBar and Scatter Charts
Compare categories with bar charts and reveal relationships with scatter plots.
- 9mHistograms and Distributions
Use histograms to see the shape (distribution) of a single numeric column.
- 9mSeaborn Statistical Plots
Meet seaborn, a DataFrame-friendly layer on matplotlib, and read a box plot.
- 9mCorrelation Heatmaps
Measure how columns move together with correlation and visualize it as a heatmap.
- 7mPractice: Visualization
Mixed reps across the whole module: pick the right chart, read a chart, and fill the plotting call.
Module 5. Jupyter Notebooks
Interactive notebooks, reproducible execution, and the standard EDA workflow
- 8mIntro to Jupyter Notebooks
What a Jupyter Notebook is, the code and markdown cells you work in, the kernel that remembers your variables, and how to launch it — the tool data science actually runs on.
- 9mNotebook Workflow
The #1 thing that makes notebooks reproducible: cell execution order and hidden state, the Restart & Run All habit, the execution-count markers, essential shortcuts, and magic commands.
- 9mExploring a New Dataset (EDA)
The repeatable EDA ritual you run on every new dataset in a notebook — load, first look, missing audit, distributions, correlations, then answer real questions — assembled from everything in Modules 1-4.
- 8mPractice: Notebooks & EDA
Pure practice for Module 5 — predict cell output, spot the out-of-order execution bug, order the EDA steps, and read info/describe output — then wrap up the module.
Module 6. AI Data Workflows
Features and targets, train/test split, encoding, scaling, training a model, and evaluation
- 9mLoading and Exploring Datasets
Where machine-learning data comes from, how to load scikit-learn's built-in datasets, and the exploration checklist every project starts with — including the class-balance check.
- 8mFeatures and Targets
The split every supervised dataset has: features (X) are the input clues you learn from, the target (y) is the answer you predict — and why sklearn expects X to be 2D.
- 9mTrain/Test Split
Why you must evaluate a model on data it never saw: overfitting, holding out a test set with train_test_split, and what random_state does.
- 9mEncoding Categorical Data
Models do math, so text categories must become numbers: label encoding (only for ordered categories) vs one-hot encoding (for unordered ones), and the fake-ordering trap.
- 9mFeature Scaling
Putting numeric columns on a comparable range with StandardScaler and MinMaxScaler — and the critical rule: fit on the training set ONLY, or you cause data leakage.
- 10mThe Preprocessing Pipeline
Assemble encoding, scaling, and the train/test split into the one correct end-to-end order — and see how the wrong order silently leaks data.
- 9mTraining Your First Model
Meet scikit-learn's estimator API: every model learns with model.fit(X, y) and predicts with model.predict(X) — the same two methods, every time.
- 10mEvaluating Models
Why accuracy lies on imbalanced data, and the metrics that tell the truth: precision, recall, F1, and the confusion matrix.
- 9mPractice: The ML Workflow
Pure reps through the full machine-learning pipeline: X vs y, splitting, spotting data leakage, encoding choices, fit/predict order, and reading a confusion matrix.
Module 7. Final Projects
Real AI data projects and a full end-to-end capstone to cement your skills
- 25mProject: The Dataset Analyzer
Build analyze.py, a reusable command-line tool that profiles any CSV file and saves distribution and correlation charts — folding six modules of skills into one program.
- 30mProject: The AI Data Explorer
Build an end-to-end machine-learning notebook: load a dataset, run full EDA, preprocess, train a RandomForest, and evaluate it — every cell annotated with the module that taught the technique.
- 12mCapstone: The Complete Pipeline
Walk one complete, annotated machine-learning pipeline end to end — clean, split into X/y, split-then-scale, train a RandomForest, and read a confusion matrix — with every stage tracing back to the module that taught it.
Frequently asked questions
- Is the Python for AI course free?
- You can preview lessons for free with no account. Full access to this Pro course is included with a Kodion Pro subscription.
- Do I need prior programming experience?
- This is a intermediate course, so you'll get the most from it if you're already comfortable with the basics of programming.
- How long does Python for AI take to complete?
- It's 46 lessons across 7 modules, roughly 8 hours of hands-on learning. You can go entirely at your own pace.
- What will I learn?
- You'll work through NumPy Fundamentals, Pandas Fundamentals, Data Cleaning, and more, building real, applied skills through interactive lessons and coding challenges.
- Can I get help if I'm stuck?
- Yes. Kodion's built-in AI tutor gives instant, context-aware hints and explanations right inside each lesson as you code.
Ready to start Python for AI?
Create a free account to track progress, earn XP, and get instant help from the AI tutor as you code.
Create your free account