Thursday, November 27, 2025

✅ πŸ“˜ Beginner Level Projects of DataFrame (Easy)

 

Pandas DataFrame

1️⃣ Project: Student Marks Visualization

Objective: Read student marks, calculate total & average, and plot a bar chart.

Concepts Used: DataFrame creation, column operations, bar plot.

Sample Code:

import pandas as pd import matplotlib.pyplot as plt data = { 'Name': ['Amit', 'Riya', 'John'], 'Math': [80, 90, 75], 'Science': [85, 88, 70], 'English': [78, 92, 82] } df = pd.DataFrame(data) df['Total'] = df[['Math', 'Science', 'English']].sum(axis=1) plt.bar(df['Name'], df['Total']) plt.title("Total Marks of Students") plt.xlabel("Students") plt.ylabel("Total Marks") plt.show()

2️⃣ Project: Daily Temperature Line Chart

Objective: Visualize temperature trend over 7 days.

Concepts Used: Line plot, indexing.

Sample Code:

import pandas as pd import matplotlib.pyplot as plt data = { 'Day': ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'], 'Temp': [30, 32, 31, 29, 28, 33, 34] } df = pd.DataFrame(data) plt.plot(df['Day'], df['Temp'], marker='o') plt.title("Daily Temperature") plt.xlabel("Day") plt.ylabel("Temperature (°C)") plt.show()

3️⃣ Project: Product Sales Pie Chart

Objective: Show sales % of products.

Concepts Used: Pie chart, percentage labels.

Sample Code:

import pandas as pd import matplotlib.pyplot as plt data = { 'Product': ['Shoes','Bags','Shirts','Jeans'], 'Sales': [450, 300, 200, 150] } df = pd.DataFrame(data) plt.pie(df['Sales'], labels=df['Product'], autopct='%1.1f%%') plt.title("Product Sales Distribution") plt.show()

No comments:

Post a Comment

Python Viva Questions

  Basic Python Viva Questions 1. What is Python? Python is a high-level, interpreted, and object-oriented programming language used for w...