Skip to content
Free course Data Analytics Certificate included

Python for Data Analysis with Pandas

Load, clean, summarise and chart real data with Python

  • Intermediate level
  • 12 hours
  • 13 lessons
  • English
  • By Muninder Singh

What you'll learn

  • Work in Jupyter Notebook or Google Colab and organise an analysis
  • Use NumPy arrays for fast calculations on many values
  • Create and inspect pandas Series and DataFrames
  • Read CSV and Excel files and explore them with head, info and describe
  • Select and filter data with loc, iloc, conditions and query
  • Clean missing values, duplicates, wrong data types, messy text and dates
  • Summarise data with groupby, merge and pivot_table
  • Draw clear charts with matplotlib and complete an end-to-end sales analysis

Course curriculum

4 sections · 13 lessons · 8h 55m

01Getting Started with the Data Toolkit 3 lessons
  • Jupyter Notebook and Google Colab Setup Free preview30 min

    Why analysts use notebooks

    Data analysis with Python is usually done in a notebook rather than a plain .py file. A notebook is a document made of cells. A cell can hold code or notes. You run one cell at a time and the result appears directly below it: a number, a table or a chart. You can try an idea, look at the output, fix it and move on without re-running the whole program.

    The two most common notebook tools are Jupyter Notebook (or the newer JupyterLab), which runs on your own computer, and Google Colab, which runs in the browser on Google's servers.

    Google ColabJupyter on your computer
    InstallationNone, just a browserPython plus Jupyter
    InternetNeeded all the timeNot needed after setup
    Librariespandas, NumPy, matplotlib already includedYou install them once
    FilesUpload, or connect Google DriveNormal folders on your disk
    Best forLow-spec laptops, cyber cafés, quick startDaily work, private data

    Option 1: Google Colab (fastest start)

    1. Sign in to your Google account and open colab.research.google.com.
    2. Click New notebook. A notebook named something like Untitled0.ipynb opens and is saved in your Google Drive.
    3. Rename it by clicking the name at the top, for example pandas-practice.ipynb.
    4. Type code in the first cell and press Shift + Enter to run it.

    To use your own data file, click the folder icon on the left and then the upload button. Uploaded files are deleted when the session ends, so keep the originals on your computer or in Drive.

    Option 2: Jupyter on your computer

    If Python 3 is already installed, open Command Prompt (Windows) or Terminal (macOS/Linux) and run:

    pip install notebook pandas numpy matplotlib openpyxl
    jupyter notebook

    A browser tab opens showing your folders. Choose New → Python 3 to create a notebook. Keep the command window open while you work, because closing it stops Jupyter. On some systems the command is pip3 or python -m pip instead of pip.

    Many people also use Visual Studio Code with the Python and Jupyter extensions, which can open .ipynb files directly.

    Your first cells

    Type this in a code cell and run it:

    import pandas as pd
    import numpy as np
    print("pandas version:", pd.__version__)

    import pandas as pd loads the library under the short name pd. Almost every pandas tutorial and job uses this naming, so stick to it. The version number tells you which pandas you have. This course works with current 2.x and 3.x releases.

    Now try a quick calculation:

    prices = [120, 95, 130]
    sum(prices)

    Output:

    345

    Notice that you did not need print(). A notebook automatically displays the value of the last line in a cell.

    Markdown cells for notes

    Change a cell's type to Markdown (in Colab click + Text; in Jupyter press M while the cell is selected) and write headings and notes such as "Step 1: load the data". Good analysts explain each step, so that a manager, or you three months later, can follow the reasoning.

    Useful keyboard shortcuts

    • Shift + Enter: run the cell and move to the next one
    • Ctrl + Enter: run the cell and stay on it
    • A / B (Jupyter, outside a cell): insert a cell above or below
    • Esc then D D (Jupyter): delete a cell

    Common mistakes

    • Running cells out of order. A notebook remembers variables from cells you ran earlier, even if you have since deleted them. If results look strange, use Restart and run all (Jupyter: Kernel menu; Colab: Runtime menu).
    • NameError: name 'pd' is not defined means the import cell was not run in this session. Run it first.
    • Forgetting to save. Colab saves to Drive automatically. In Jupyter press Ctrl + S often.

    Key points

    • A notebook mixes code, output and notes in one file (.ipynb).
    • Colab needs no installation; Jupyter works offline on your computer.
    • Import pandas as pd and NumPy as np.
    • Use Restart and run all to check that your notebook works from top to bottom.

    Practice task

    1. Create a new notebook in Colab or Jupyter called pandas-practice.
    2. Add a Markdown cell with the heading "My first data notebook" and one line about why you are learning pandas.
    3. In a code cell, import pandas and NumPy and print the pandas version.
    4. Make a list of your expenses for five days, then display the total and the highest value using sum() and max().
    5. Restart the notebook, run all cells, and confirm that everything still works.
  • NumPy Basics for Data Analysis Free preview40 min

    Why learn NumPy first?

    NumPy (Numerical Python) is the library that makes calculations on many numbers fast. Pandas is built on top of it: every numeric column in a pandas table is stored as a NumPy array. You will not write much pure NumPy as an analyst, but understanding arrays explains how pandas behaves.

    Lists vs arrays

    With a normal Python list, adding 18% GST to every price needs a loop. With a NumPy array, the operation applies to every element at once. This is called vectorisation.

    import numpy as np
    
    prices = np.array([120, 95, 130, 80, 150])
    print(prices * 2)
    print(np.round(prices * 1.18, 2))

    Output:

    [240 190 260 160 300]
    [141.6 112.1 153.4  94.4 177. ]

    Compare that with a list: [120, 95] * 2 gives [120, 95, 120, 95], because for lists * means "repeat", not "multiply each value".

    Quick statistics

    Arrays have built-in methods for summaries:

    print(prices.sum(), prices.mean(), prices.max(), prices.min())
    print(prices.std().round(2))

    Output:

    575 115.0 150 80
    24.9

    std() is the standard deviation, which measures how spread out the values are.

    Filtering with conditions

    A comparison on an array gives an array of True/False values called a boolean mask. Use the mask inside square brackets to keep only the matching values:

    print(prices > 100)
    print(prices[prices > 100])

    Output:

    [ True False  True False  True]
    [120 130 150]

    This same idea is how you filter rows in pandas later in the course, so it is worth practising now.

    Two-dimensional arrays

    An array can have rows and columns, like a small table. Here are sales of three products (columns) over two days (rows):

    sales = np.array([[10, 20, 30],
                      [40, 50, 60]])
    print(sales.shape)
    print(sales.sum(axis=0))   # total per column (product)
    print(sales.sum(axis=1))   # total per row (day)

    Output:

    (2, 3)
    [50 70 90]
    [ 60 150]

    shape gives (rows, columns). The axis argument confuses many learners: axis=0 works down the rows and gives one answer per column, while axis=1 works across the columns and gives one answer per row. Pandas uses the same convention.

    Creating arrays quickly

    CodeResult
    np.arange(0, 10, 2)[0 2 4 6 8] (start, stop, step; stop not included)
    np.zeros(3)[0. 0. 0.]
    np.ones(4)[1. 1. 1. 1.]
    np.linspace(0, 1, 5)five evenly spaced values from 0 to 1

    Missing values: NaN

    NumPy represents a missing number as np.nan ("not a number"). Any arithmetic with nan gives nan, so normal functions can return nan for the whole array. NumPy has "nan-safe" versions:

    marks = np.array([10, np.nan, 20])
    print(marks.mean())
    print(np.nanmean(marks))

    Output:

    nan
    15.0

    Pandas handles missing values more conveniently, as you will see in Section 3, but it uses the same NaN idea.

    One type per array

    All elements of an array share one data type (dtype), such as int64 or float64. If you mix an integer and a decimal, everything becomes a float. If you mix numbers and text, everything becomes text and maths stops working. This is why a single stray word such as "NA" in a numeric column of a CSV file can turn the whole column into text in pandas.

    Common mistakes

    • Using Python's max(list) habits on huge data instead of array methods, which is slower.
    • Mixing up axis=0 and axis=1. Check shape and test on a tiny example.
    • Expecting prices[1:3] to include position 3. Slices stop before the end index, just like lists.

    Key points

    • NumPy arrays apply operations to every element at once.
    • Boolean masks such as prices[prices > 100] filter data.
    • axis=0 gives one result per column; axis=1 gives one per row.
    • np.nan marks missing numbers; use nan-safe functions or pandas.

    Practice task

    1. Create an array of daily milk sales in litres for seven days: [42, 38, 45, 50, 41, 39, 55].
    2. Print the total, the average and the highest day.
    3. Show only the days with sales above 44 litres, and count how many there are using .sum() on the boolean mask.
    4. The price is ₹56 per litre. Create an array of daily revenue.
    5. Make a 2-D array of sales for two shops over three days and calculate the totals per shop and per day using axis.
  • Pandas Series and DataFrames 40 min
02Loading and Exploring Data 3 lessons
  • Reading CSV and Excel Files 40 min
  • Selecting and Filtering Data 45 min
  • Sorting, New Columns and apply 40 min
03Cleaning and Summarising 3 lessons
  • Handling Missing Values and Duplicates 45 min
  • Fixing Data Types, Text and Dates 45 min
  • Grouping and Aggregating with groupby 45 min
04Combining, Charting and the Final Project 4 lessons
  • Merging Tables and Pivot Tables 45 min
  • Charts with Matplotlib 40 min
  • Final Project: End-to-End Sales Analysis 60 min
  • Final Exam 20 min

About this course

From spreadsheets to Python

If you already know a little Python, pandas is the next step. It is the most widely used Python library for working with tables of data. Tasks that take many clicks in a spreadsheet, such as cleaning 50,000 rows, combining two files or building a monthly summary, take a few lines of pandas code. The same code runs again next month on new data.

How you will learn

You will work in a notebook (Jupyter on your computer, or Google Colab in the browser, which is free and needs no installation). Every lesson uses small, realistic Indian datasets, such as shop sales, student marks and city orders, that you type or create yourself. Each lesson shows the code, the output it produces and the common mistakes, and ends with a practice task.

What you will build

You will finish with a complete sales analysis notebook. It loads a messy file, cleans it, calculates revenue by month, city and product, draws charts and exports a summary. You can show this kind of project to employers.

Who this course is for

Students, job seekers aiming for data or MIS roles, Excel users who want to automate their work, and anyone who has finished a beginner Python course. Take our Python Programming for Beginners course first if you are new to Python.

Requirements

  • Basic Python: variables, lists, dictionaries, loops and functions
  • A computer with Python 3 and Jupyter, or a Google account for Google Colab
  • Basic spreadsheet knowledge is helpful but not required

Earn a verifiable certificate

Pass the final online exam (20 minutes, 15 questions, pass mark 40%) to receive your certificate instantly. Each certificate has a unique number and QR code for instant verification.

This is an independent, institute-issued skill-training certificate — not a government-recognised degree or diploma.

Your educator

M

Muninder Singh

Frequently asked questions

Do I need to know Python before this course?
Yes, the basics. You should be comfortable with variables, lists, dictionaries, loops and functions. Our free Python Programming for Beginners course covers all of these.
Can I do this course without installing anything?
Yes. Google Colab runs in the browser and already includes pandas, NumPy and matplotlib. You only need a Google account and an internet connection.
Which version of pandas does the course use?
The code uses the current pandas 2.x and 3.x style and avoids removed or deprecated functions such as DataFrame.append. Small differences in how output is displayed between versions are normal.
Is pandas better than Excel?
They do different jobs. Excel is great for quick, visual work. Pandas is better for large files, repeated monthly tasks and combining many files, because the steps are saved as code you can run again.
Is the certificate free?
Yes. Pass the final exam with 40% or more to download it. It is an independent skill-training certificate from GCI EDU, not a government-recognised qualification.

Have a question about this course?

Leave your details and our team will get back to you, usually within one working day.

Share a phone number or an email so we can reach you. We never share your details.

You may also like

Data Analytics

Data Analysis with Excel

Turn raw data into clear answers with formulas, pivot tables and charts

9 hrs 13 lessons Beginner Certificate

Free

Includes certificate

Enrol free