Python and Data Analysis
Python and Data Analysis
This course is designed to take students from Python basics through to advanced data science
applications. The curriculum combines theoretical knowledge with practical hands-on
assignments and projects to ensure students gain applicable skills for real-world scenarios.
Learning Objectives
● Write and debug Python programs using proper syntax and programming practices
● Manipulate various data structures and implement control flow in Python
● Implement object-oriented programming concepts
● Perform data analysis, statistical measurements, and data visualization
● Work with popular data science libraries (NumPy, Pandas, Matplotlib)
● Extract insights from real-world datasets
● Automate tasks using Python
● Implement data scraping techniques
● Apply Python skills to business and research scenarios
● Python 3.x
● Jupyter Notebook/Lab
● Integrated Development Environment (PyCharm, VS Code, etc.)
● Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy
● Access to datasets for practice
Practical Lab
Assignment 1
1. Number Manipulator: Write a program that takes a number as input, performs various
operations (multiply by 3, add 8, divide by 2, subtract 4), and outputs the result.
2. Temperature Converter: Create a program that converts temperatures between Celsius
and Fahrenheit based on user input.
3. Simple Calculator: Build a basic calculator that can perform addition, subtraction,
multiplication, and division operations based on user inputs.
4. String Analyzer: Create a program that takes a string input and outputs the number of
characters, words, and whether it's a palindrome.
5. Budget Calculator: Write a program that accepts income and multiple expense inputs,
then calculates remaining budget and percentage of income spent.
Week 2: Data Structures and Control Flow (1.5 hour)
Practical Lab
Assignment 2
1. List Manipulator: Create a program that performs various operations on a list (sorting,
counting elements, finding max/min, removing duplicates).
2. Dictionary Manager: Build a contact management system using dictionaries to store
names, phone numbers, and emails with add, delete, and search functionality.
3. Shopping Cart: Implement a shopping cart program using appropriate data structures
that allows adding items, removing items, and calculating the total price.
4. Grade Categorizer: Write a program that takes student scores as input and categorizes
them into grades (A, B, C, D, F) using conditional statements.
5. Data Structure Converter: Create a program that can convert between different data
structures (list to set, tuple to list, dictionary to list of tuples, etc.).
Practical Lab
Assignment 3
1. Pattern Printer: Create a program that prints various patterns (pyramid, diamond, etc.)
using nested loops.
2. Number Analyzer: Write a program that analyzes a list of numbers to find prime
numbers, factorial calculations, and Fibonacci sequence positions.
3. Matrix Operations: Implement basic matrix operations (addition, subtraction, transpose)
using nested lists or NumPy arrays.
4. Data Filter: Create a program that filters data from a list based on multiple criteria using
loops and conditional statements.
5. Text Analyzer: Build a program that analyzes text to count word frequency, sentence
length, and character distribution using appropriate loops and data structures.
Practical Lab
Assignment 4
1. Bank Account System: Create a class hierarchy for different types of bank accounts
(savings, checking) with methods for deposit, withdrawal, and interest calculation.
2. Library Management: Implement a simple library system with classes for books,
members, and the library itself, demonstrating inheritance and polymorphism.
3. Shape Calculator: Design a class hierarchy for different shapes (circle, rectangle,
triangle) with methods to calculate area and perimeter, showcasing polymorphism.
4. Custom Iterator: Create a custom iterator class that iterates through a sequence in a
specific pattern (e.g., only even positions, in reverse, or with a step value).
5. E-commerce System: Build a simple e-commerce system with classes for products,
cart, and users, demonstrating how objects interact within a system.
Practical Lab
Assignment 5
1. Log Analyzer: Create a program that reads a log file, parses its content, and provides
statistics about errors, warnings, and other patterns.
2. CSV Data Processor: Write a program that reads a CSV file, performs calculations on
the data, and writes the results to a new CSV file.
3. JSON Configuration Manager: Implement a program that reads, updates, and writes to
a JSON configuration file, allowing users to modify settings.
4. File Backup System: Create a program that backs up specified files to a designated
directory, including timestamp information.
5. Text File Merger: Build a utility that combines multiple text files into a single file with
options for ordering and formatting the content.
Week 6: Project Development (1.5 hour)
Practical Lab
Project Guidelines
1. Personal Finance Manager: Create an application that tracks income, expenses, and
savings with visualization of spending patterns.
2. Weather Data Analyzer: Build a system that fetches weather data, analyzes trends, and
provides insights with visualizations.
3. Task Management System: Develop a program for managing tasks, deadlines, and
priorities with persistent storage.
4. Text-based Game: Create an interactive adventure game demonstrating object-oriented
design and file handling.
5. Data Analysis Dashboard: Build a system that analyzes a dataset of your choice and
presents findings through an interactive interface.
Week 7: Introduction to Data Analysis (1.5 hour)
Practical Lab
Practical Lab
● Regression analysis
● Time series analysis basics
● Statistical tests (t-test, chi-square, ANOVA)
● Data cleaning techniques
● Handling missing values
● Outlier detection and treatment
● Data normalization methods
● Feature scaling techniques
● Dimensionality reduction
● Principal Component Analysis (PCA)
Practical Lab
Practical Lab
Practical Lab
Practical Lab
● Introduction to SQL
● Database connections in Python
● Basic SQL queries (SELECT, INSERT, UPDATE, DELETE)
● Pandas and SQL integration
● Excel automation with Python
● Reading and writing Excel files
● Excel data manipulation
● Excel report generation
● Automated data processing workflows
Practical Lab
Practical Lab
1. Market Analysis: Analyze market trends and consumer behavior for a specific industry.
2. Health Data Analysis: Explore health metrics and identify patterns or risk factors.
3. Financial Portfolio Optimization: Analyze financial data to optimize investment
strategies.
4. Social Media Sentiment Analysis: Analyze sentiment patterns across social platforms.
5. Environmental Data Monitoring: Analyze environmental data to identify patterns and
concerns.
Assessment Structure
● Assignments (40%): Weekly programming assignments
● Mid-term Project (20%): Week 6 project
● Participation and Labs (10%): In-class engagement and lab work
● Final Project (30%): Week 15 capstone project
Online Resources
● https://www.w3schools.com/python/
● https://www.tutorialspoint.com/python/index.htm
● https://youtu.be/Ri1Lgdew8Ds?si=hrbo4VHFT_s_fKpt
● https://youtu.be/7wnove7K-ZQ?si=i3Uiq9Ba_2JsiXus
● https://youtu.be/OdtVdjtONb4?si=Csfi9Xgy-rD1c-bI
Additional Tools