Manage Reservations
Example Prompt:
Example Response:
import json
# Sample data file with existing reservations
reservations_file = 'reservations.json'
# Load existing reservations from the file
try:
with open(reservations_file, 'r') as file:
reservations = json.load(file)
except FileNotFoundError:
reservations = {}
# Function to add a reservation
def add_reservation(name, date, time, party_size):
reservation_id = len(reservations) + 1
reservations[reservation_id] = {'name': name, 'date': date, 'time': time, 'party_size': party_size}
save_reservations()
print(f'Reservation for {name} added successfully!')
# Function to view all reservations
def view_reservations():
for res_id, details in reservations.items():
print(f'Reservation ID: {res_id}, Name: {details['name']}, Date: {details['date']}, Time: {details['time']}, Party Size: {details['party_size']}')
# Function to delete a reservation
def delete_reservation(reservation_id):
if reservation_id in reservations:
del reservations[reservation_id]
save_reservations()
print(f'Reservation ID {reservation_id} deleted successfully!')
else:
print('Reservation ID not found.')
# Function to save reservations to the file
def save_reservations():
with open(reservations_file, 'w') as file:
json.dump(reservations, file)
# Example usage
add_reservation('John Doe', '2023-10-15', '19:00', 4)
view_reservations()
delete_reservation(1)
view_reservations()
Related Tasks:
Greet and Seat Guests
Example Prompt:
Example Response:
Related Tasks:
Coordinate with Kitchen and Waitstaff
Example Prompt:
Example Response:
Related Tasks:
Collect and Analyze Customer Feedback
Example Prompt:
Example Response:
import pandas as pd
# Load the customer feedback CSV file
feedback_df = pd.read_csv('customer_feedback.csv')
# Display the first few rows of the dataframe
print(feedback_df.head())
# Check for missing values
print(feedback_df.isnull().sum())
# Example of summarizing feedback
positive_feedback = feedback_df[feedback_df['sentiment'] == 'positive']
negative_feedback = feedback_df[feedback_df['sentiment'] == 'negative']
print(f'Total Positive Feedback: {len(positive_feedback)}')
print(f'Total Negative Feedback: {len(negative_feedback)}')
# Display common themes
common_themes = feedback_df['comments'].str.split(expand=True).stack().value_counts()
print('Most Common Themes in Feedback:')
print(common_themes.head(10))
Related Tasks:
Organize Special Events
Example Prompt:
Example Response:
Related Tasks: