Data Analysis with NumPy and pandas
Turn raw tables into answers: NumPy arrays, pandas DataFrames, cleaning, grouping, joining, dates, charts and short reports, with Ghanaian shop and World Bank data.
- 0 students
- 91 lessons
- 7 h 5 min
Created by Ayim Nelson
What you will learn
- Do maths on whole columns at once with NumPy arrays, masks and axis totals
- Load CSV and JSON data into pandas and inspect it with head, info, dtypes and describe
- Select and filter rows and columns with loc, iloc, conditions, isin and between
- Clean messy data: missing values, duplicates, wrong types, untidy text and typos
- Summarise with groupby, agg, value_counts, pivot tables and crosstab
- Combine tables with concat and merge, and reshape them with melt and pivot
- Work with dates: date parts, resampling by week and month, rolling averages and percent change
- Choose honest charts, make them with matplotlib, and report findings clearly and privately
About this course
This is a hands-on first course in data analysis with Python. You follow Akwaaba Market, a shop with branches in Accra, Kumasi, Tamale and Takoradi, from a raw CSV of sales to a one-page report for the owner. Along the way you learn NumPy arrays and vectorised maths, then pandas: reading CSV, selecting and filtering, cleaning messy data, grouping, joining and reshaping tables, working with dates, and making honest charts. Real World Bank data on mobile money and bank accounts in Ghana, and COCOBOD cocoa prices, appear alongside the shop's invented data.
For: anyone who has finished the Python Crash Course (variables, lists, dicts, loops, functions) and wants to answer real questions with data. You don't need maths beyond percentages and averages. Every task runs in your browser.
By the end: you'll have cleaned a messy branch report, found the best branch per category, joined sales to a products table, tracked a monthly MoMo trend, drawn text charts and written an end-of-month report and a final project on mobile money in Ghana.
Course content
11 sections · 91 lessons
Why data analysis6 lessons
- What a data analyst doesPreviewReading · 3 min
- Questions before codePreviewReading · 3 min
- Tables: rows and columnsPreviewReading · 3 min
- Meet the Akwaaba sales dataReading · 4 min
- Notebooks and the code boxes hereReading · 3 min
- Count sales with plain PythonExercise · 10 min
NumPy arrays11 lessons
- Lists vs arraysReading · 3 min
- Making arraysReading · 3 min
- Array mathsReading · 3 min
- Broadcasting one numberReading · 3 min
- Indexing and slicing arraysReading · 3 min
- Boolean masksReading · 4 min
- sum, mean, min and maxReading · 3 min
- 2-D arrays and shapeReading · 3 min
- Totals along an axisReading · 3 min
- Random numbers with a seedReading · 3 min
- Daily takings by branchExercise · 12 min
pandas Series and DataFrames10 lessons
- Importing pandasReading · 3 min
- SeriesReading · 3 min
- Labels and the indexReading · 3 min
- DataFramesReading · 3 min
- Reading CSV from textReading · 4 min
- head, tail and shapeReading · 3 min
- info and dtypesReading · 3 min
- Choosing columnsReading · 3 min
- File formats: CSV, JSON, Excel and ParquetReading · 4 min
- Load and inspect the salesExercise · 12 min
Selecting and filtering10 lessons
- loc: rows and columns by labelReading · 4 min
- iloc: rows and columns by positionReading · 3 min
- Filtering rows with a conditionReading · 3 min
- Several conditionsReading · 3 min
- isin and betweenReading · 3 min
- Sorting valuesReading · 3 min
- Adding new columnsReading · 3 min
- Renaming and dropping columnsReading · 3 min
- The biggest rows: nlargestReading · 3 min
- Find the big MoMo salesExercise · 12 min
Cleaning data10 lessons
- Spotting missing valuesReading · 3 min
- Dropping rows with dropnaReading · 3 min
- Filling gaps with fillnaReading · 3 min
- Duplicate rowsReading · 3 min
- Tidying text with .strReading · 4 min
- Replacing valuesReading · 3 min
- Fixing typesReading · 4 min
- Dates with to_datetimeReading · 3 min
- Outliers and typosReading · 4 min
- Clean the messy branch reportExercise · 15 min
Grouping and summarising10 lessons
- describe for a quick summaryReading · 3 min
- Unique values and countsReading · 3 min
- Shares with value_countsReading · 3 min
- groupby: one total per groupReading · 4 min
- Grouping by two columnsReading · 3 min
- agg: several summaries at onceReading · 4 min
- Pivot tablesReading · 4 min
- crosstab: counting pairsReading · 3 min
- Percent of totalReading · 3 min
- Best branch per categoryExercise · 15 min
Combining and reshaping tables9 lessons
- concat: stacking tablesReading · 3 min
- merge: joining on a keyReading · 4 min
- Inner and left mergesReading · 3 min
- Keys that don't matchReading · 3 min
- From SQL JOIN to mergeReading · 3 min
- Wide and long dataReading · 3 min
- melt: wide to longReading · 4 min
- pivot: long to wideReading · 3 min
- Sales with product namesExercise · 15 min
Dates and time series7 lessons
- Date parts: month and weekdayReading · 3 min
- Dates as the indexReading · 3 min
- resample by week and monthReading · 4 min
- Rolling averagesReading · 3 min
- Percent changeReading · 3 min
- Weekly patterns and trendsReading · 4 min
- Monthly MoMo trendExercise · 15 min
Charts8 lessons
- Choosing a chartReading · 3 min
- Text bar chartsReading · 3 min
- A bar chart with matplotlibReading · 4 min
- Line charts for change over timeReading · 3 min
- Histograms for spreadReading · 3 min
- Charts straight from pandasReading · 3 min
- Making charts honestReading · 4 min
- Text chart of sales per branchExercise · 12 min
Telling the story6 lessons
- Asking the right questionReading · 3 min
- Writing a finding in one sentenceReading · 3 min
- Formatting numbers for peopleReading · 3 min
- A one-page reportReading · 4 min
- Privacy: aggregate, don't expose peopleReading · 4 min
- End-of-month branch reportExercise · 15 min
Final project4 lessons
- Project brief: mobile money in GhanaReading · 4 min
- Final project: accounts and the shopExercise · 25 min
- What to learn nextReading · 3 min
- Final quizQuiz · 10 min
Reviews
No reviews yet.
Comments
Log in to join the conversation.
Loading comments...