Coding issue in Restaurant code



0
def getUserReviews(restID, usersList, df):
mask = (df.business_id == restID) & (df.user_id.isin(usersList))
reviews = df([mask]
reviews = reviews[reviews.user_id.duplicated() == False]
return list(reviews)

This code block is giving an error:


File "", line 4
reviews = reviews[reviews.user_id.duplicated() == False]
^
SyntaxError: invalid syntax

1 Answer(s)


0

The error is in the line before the highlighted line.

reviews = df([mask]

Has an extra (

It should be: reviews = df[mask]

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password