-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel3task2a.py
More file actions
19 lines (15 loc) · 781 Bytes
/
Level3task2a.py
File metadata and controls
19 lines (15 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pandas as pd
# Load the dataset
df = pd.read_excel('Level 2.xlsx')
# Step 2: Find the restaurant with the highest and lowest number of votes
highest_votes_restaurant = df.loc[df['Votes'].idxmax()]
lowest_votes_restaurant = df.loc[df['Votes'].idxmin()]
# Step 3: Display the results
print("Restaurant with the Highest Number of Votes:")
print(f"Restaurant Name: {highest_votes_restaurant['Restaurant Name']}")
print(f"Votes: {highest_votes_restaurant['Votes']}")
print(f"Location: {highest_votes_restaurant['City']}")
print("\nRestaurant with the Lowest Number of Votes:")
print(f"Restaurant Name: {lowest_votes_restaurant['Restaurant Name']}")
print(f"Votes: {lowest_votes_restaurant['Votes']}")
print(f"Location: {lowest_votes_restaurant['City']}")