Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Problem_Statement2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
import matplotlib.pyplot as plt
import seaborn as sns
# Load the dataset
df=pd.read_csv(r"C:\Users\ayush\OneDrive\Desktop\PythonCA2\Data.csv")

###Objective 1: Identify constituencies with the highest and lowest number of candidates
# Count candidates per constituency
candidates_per_constituency = df.groupby('ac_name')['candidate_name'].nunique()
# Find the highest and lowest
highest_constituency = candidates_per_constituency.idxmax()
lowest_constituency = candidates_per_constituency.idxmin()
print(f"Constituency with highest candidates:{highest_constituency}({candidates_per_constituency.max()} candidates)")
Expand Down