im doing a code and im kinda stuck on the pandas functions
this is my code for what im trying to do
def get_service():
flag = True
while flag:
service_choice = input("What type of service would you like to select 'Lunch' or 'Dinner' ").upper()
if service_choice == "LUNCH" or service_choice == "DINNER":
flag = False
else:
print("Not a valid option. Please try again")
return service_choice
def get_product_choice():
flag = True
while flag:
print("######################################################")
print("Please choose a menu item form the list:")
print("Please enter the number of the item (1-8)")
print("1. Nachos")
print("2. Soup")
print("3. Burger")
print("4. Brisket")
print("5. Ribs")
print("6. Corn")
print("7. Fries")
print("8. Salad")
print("######################################################")
menu_list = ["Nachos","Soup","Burger", "Brisket","Ribs","Corn", "Fries", "Salad"]
item_choice = input("Please enter the number of your choice (1-8): ")
try:
item_choice = int(item_choice)
except ValueError:
print("Sorry, you did not enter a valid choice")
flag = True
else:
if int(item_choice) < 1 or int(item_choice) > 8:
print("Sorry, you did not enter a valid choice")
flag = True
else:
item_name = menu_list[int(item_choice)-1]
return item_name
elif main_menu == 2:
# service and food
service = get_service()
item = get_product_choice()
df1 = pd.read_csv("Task4a_data.csv") ```
im trying to "Show trends and patterns over time for lunch and dinner services" by making a dataframe which allows you to select which food and service type and it shows you on a dataframe