Get startedGet started for free

Scooter dispatch

The City Council were huge fans of Sam's prediction about whether scooter was blocking a sidewalk or not. So much so, they asked her to build a notification system to dispatch crews to impound scooters from sidewalks.

With the dataset she created, Sam can dispatch crews to the case's coordinates when a request has negative sentiment.

Scooter Dataframe

In this exercise, you will help Sam implement a system that dispatches crews based on sentiment and image recognition. You will help Sam pair human and machine for effective City management!

This exercise is part of the course

Introduction to AWS Boto in Python

View Course

Exercise instructions

  • Get the SNS topic ARN for 'scooter_notifications'.
  • For every row, if sentiment is 'NEGATIVE' and there is an image of a scooter, construct a message to send.
  • Publish the notification to the SNS topic.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Get topic ARN for scooter notifications
topic_arn = sns.____(Name='____')['____']

for index, row in scooter_requests.iterrows():
    # Check if notification should be sent
    if (row['____'] == 'NEGATIVE') & (row['img_scooter'] == ____):
        # Construct a message to publish to the scooter team.
        message = "Please remove scooter at {}, {}. Description: {}".____(
            row['long'], row['lat'], row['public_description'])

        # Publish the message to the topic!
        sns.____(____ = topic_arn,
                    ____ = message, 
                    ____ = "Scooter Alert")
Edit and Run Code