Python Pandas Exercises for Data Analysis

May 12, 2021 José B

8 python pandas exercises designed to challenge your logical muscle and to help internalize data manipulation with python’s pandas.

import pandas as pd

import seaborn as sns

import numpy as np

import matplotlib.pyplot as plt

# load dataset

df = sns.load_dataset('titanic')

Exercise 1: From the given dataset print the first and last five rows.

Exercise 2: Clean the dataset and update the CSV file.

Exercise 3: Find the highest fare.

Exercise 4: Print all survivors details.

Exercise 5: Count total passengers per class.

Exercise 6: Find each class highest fare.

Exercise 7: Find the average age of passengers by class.

Exercise 8: Sort all passengers by fare and age columns.

Attachments

background

Have you thought about online lessons?

Online tuition gives you access to brilliant tutors across the country
Connect one-to-one with a tutor or share your lesson with a group for 50% of the tutor's hourly rate! Find a Tutor for One-to-One Find an Online Study Group

Want to know more?

Visit José's profile to find out more and send a message.

Visit José's Profile

Resources others found helpful

Specific Learning Disorder

This section explains what specific learning disorders are and describes some of their key features

learn more

describe a celebrity

adjectives and family members

learn more

Notting Hill and Ealing School Past Paper (Maths)

A maths past exam from 2008 for Notting Hill and Ealing School, part of the London Independent …

learn more

11+ English exercises for home

Here is a list of a few little exercises to follow at home to help with creative writing and …

learn more

Free resources, revision notes and past papers for students

Find revision guides, exam papers and sample essays amongst hundreds of free resources available to students.

Find resources any subjects

Maths resources | Science resources | Music resources | Spanish resources | English resources | French resources