-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabAssignment4.py
More file actions
35 lines (32 loc) · 923 Bytes
/
LabAssignment4.py
File metadata and controls
35 lines (32 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pandas as pd
data = {
"Employee ID": ["161E90", "161F91", "161F99", "171E20", "171G30"],
"Name": ["Raman", "Himadri", "Jaya", "Tejas", "Ajay"],
"Age": [41, 38, 51, 30, 45],
"Salary(PM)": [56000, 67500, 82100, 55000, 44000],
}
df = pd.DataFrame(data)
while True:
print(
"""Enter the choice
1. Employee ID
2. Name
3. Age
4. Salary
5.Exit """
)
choice = int(input())
if choice == 1:
query = input("Enter the query to be Employee ID ")
print(df[df["Employee ID"] == query])
elif choice == 2:
query = input("Enter the query to be Name ")
print(df[df["Name"] == query])
elif choice == 3:
query = input("Enter the query to be Age ")
print(df[df["Age"] == query])
elif choice == 4:
query = input("Enter the query to be Salary ")
print(df[df["Salary"] == query])
else:
break