
Trusted shop reviews
easyTrusted shop reviews
Etsy Pandas Interview Question
Etsy highlights trusted feedback on shop pages. A review is trusted when it gives five stars and comes from a verified purchase.
Using the reviews DataFrame, find every trusted review, showing its review_id and shop_id. Assign the answer to result.
Asked of
- Data Analyst
- Product Analyst
- Business Analyst
- Analytics Engineer
- Data Scientist
reviewsDataFrame18 rows
| Column Name | Type |
|---|---|
| review_id | int64 |
| shop_id | int64 |
| rating | int64 |
| review_date | str |
| verified_purchase | bool |
| helpful_votes | int64 |
reviewsExample Input
| review_id | shop_id | rating | review_date | verified_purchase | helpful_votes |
|---|---|---|---|---|---|
| 90001 | 4101 | 5 | 2024-03-02 | true | 12 |
| 90002 | 4102 | 4 | 2024-03-02 | true | 3 |
| 90003 | 4101 | 5 | 2024-03-03 | false | 0 |
| 90004 | 4103 | 5 | 2024-03-04 | true | 7 |
| 90005 | 4104 | 3 | 2024-03-04 | true | 1 |
| 90006 | 4102 | 5 | 2024-03-05 | true | 9 |
| 90007 | 4105 | 2 | 2024-03-06 | false | 0 |
| 90008 | 4103 | 4 | 2024-03-06 | true | 2 |
Example Output
| review_id | shop_id |
|---|---|
| 90001 | 4101 |
| 90004 | 4103 |
| 90006 | 4102 |
Explanation
Reviews 90001, 90004 and 90006 gave five stars and came from verified purchases. Review 90003 also gave five stars, but the purchase was not verified, so it is left out. The other reviews in the example gave fewer than five stars.
The example above is a small slice of the data. Your code runs against the full DataFrames.
Company
Etsy
Difficulty
easy
Topic
filtering
Language
Pandas
Your code
Loading Python in the background. You can start writing.