DATE:
EXPRIMENT-4
NUMPY MODULE
AIM: To implement python program by using numpy module .
SOURCE CODE:
import pandas as pd
# Step 1: Load the dataset from CSV
data = pd.read_csv('students_roles.csv')
# Display the loaded data
print("Original Dataset:")
print(data)
# Step 2: Analyze the Data
# Count the number of students in each role
role_counts = data['role'].value_counts()
# Display role counts
print("\nNumber of Students per Role:")
print(role_counts)
# Filter students who are Team Leaders
team_leaders = data[data['role'] == 'Team Leader']
# Display Team Leaders
print("\nList of Team Leaders:")
print(team_leaders)
DATASET DESCRIPTION:
This dataset represents the roles assigned to students in a group project setting. Each student is given a
specific role, which defines their responsibilities within the group. The roles include Team Leader,
Member, and Coordinator. This dataset can be useful for understanding the distribution of
responsibilities among students and analyzing role assignments within a group or team structure.
Columns:
1. student: The name of each student involved in the project.
2. role: The assigned role for each student, representing their position and responsibilities within the group.
Data give below:
student role
Lokeswar Team Leader
Ratnam Member
Vignesh Coordinator
Rajeev Member
Ganesh Team Leader
. Save data set by ‘students_roles.csv’.
OUTPUT:
Original Dataset:
student role
Lokeswar Team Leader
Ratnam Member
Vignesh Coordinator
Rajeev Member
Ganesh Team Leader
Number of Students per Role:
Member 2
Team Leader 2
Coordinator 1
Name: role, dtype: int64
List of Team Leaders:
student role
Lokeswar Team Leader
Ganesh Team Leader
RESULT:
Numpy module developed by using Student and role data set is successfully executed.