This repository contains a collection Python scripts developed. The projects progress from Object-Oriented Programming (OOP) principles to advanced data analysis, visualization, and real-time API integration.
The exercises are organized into 8 modules, each focusing on specific advanced Python concepts:
- Focus: Basic DataFrame manipulation.
-
Description: An analysis of a small retail dataset (
products_sales.csv). -
Key Tasks:
- Calculating total value per product (
$Price \times Quantity$ ). - Grouping data to find average prices per category.
- Sorting and identifying top-value products.
- Calculating total value per product (
- Focus: Classes, Methods, and File I/O.
- Description: Implementation of a
StudentManagersystem to handle student records. - Key Features:
Studentclass with attributes for grades and biographical data.- Methods for calculating individual and class-wide averages.
- CSV Import/Export functionality with error handling.
- Bonus: Visualization of class grades using
matplotlib.
- Focus: Integrating OOP with Pandas.
- Description: A
SalesManagerclass designed to track store transactions. - Key Features:
- Dynamic addition of sales via the
add_sale()method. - Conversion of transaction objects into a Pandas DataFrame.
- Analytics methods:
total_sales_per_category()andtop_selling_products().
- Dynamic addition of sales via the
- Focus: Data Cleaning and Exploratory Data Analysis (EDA).
- Description: Processing a raw e-commerce dataset (
sales_data.csv). - Key Tasks:
- Data Cleaning: Handling missing values and converting date formats.
- Feature Engineering: Creating new columns (e.g., Total Sales).
- Visualization: Bar charts showing sales by category and country.
- Focus: REST APIs, Financial Metrics, and Correlation.
- Description: A financial tool that fetches historical data for 5 cryptocurrencies (Bitcoin, Ethereum, etc.) using the CoinGecko API.
- Key Features:
- Fetching 30-day historical data and resampling time-series.
- Calculating Daily Returns, Volatility, and Pearson Correlation.
- Interactive visualizations using Plotly (Time series & Heatmaps).
- Focus: Real-time Data, Geo-spatial Data, and Anomaly Detection.
- Description: Analysis of live aircraft data using the OpenSky Network API.
- Key Features:
- Fetching and parsing real-time JSON data.
- Z-Score Analysis: Detecting anomalies in aircraft velocity.
- Geo-spatial filtering and Pivot Tables (Country vs. Velocity).
- Scatter plots mapping aircraft positions (Longitude/Latitude).
- Focus: Modular Programming, Regex, and Natural Language Processing.
- Description: A text mining project analyzing public sentiment and trends using a dataset of tweets (
energy_tweets.csv). - Key Features:
- Modular Architecture: Code split into 5 specialized modules (Loader, Cleaner, Analyzer, Visualizer, Main).
- Advanced Cleaning: Utilizing Regex to strip URLs, mentions, and noise.
- Frequency Analysis: Extracting trending hashtags and calculating word distributions.
- Visualization: Generating bar charts for top words and hashtags using
matplotlib.
- Focus: Descriptive Statistics, Correlation Analysis, and Visualization.
- Description: Analyzing a dataset of music tracks and their audio features (energy, danceability, tempo, etc.) using
data.csv. - Key Features:
- Data Loading: Converting raw CSV data into a Pandas DataFrame.
- Statistical Analysis: Using
.describe()and.corr()to understand feature distributions. - Correlation Heatmap: Visualizing feature relationships using
seaborn. - Feature Insights: Identifying which audio characteristics correlate most with high "Energy" tracks.
- Visualization: Bar charts displaying the average intensity of each audio feature.
To run these scripts, you will need Python 3.x and the following external libraries:
pip install pandas numpy matplotlib requests plotlyEnsure you have Python installed (version 3.x is recommended).
- Clone the repository.
git clone [https://github.com/yourusername/advanced-python-labs.git](https://github.com/yourusername/advanced-python-labs.git)- Navigate to the directory.
cd Advanced-Programming-with-Python- Run specific exercises (ensure required CSV files are in the same directory):
python main.pyThrough these exercises, the following concepts are demonstrated:
- Object-Oriented Design: Building robust classes to manage complex data structures.
- Data Science Stack: Proficiency with pandas for data manipulation and numpy for calculations.
- API Integration: Handling HTTP requests, parsing JSON, and dealing with rate limits.
- Data Visualization: Creating static (matplotlib) and interactive (plotly) charts.
- Statistical Analysis: Implementing correlation matrices and anomaly detection algorithms.