Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1: count_artist_strings (1 point) For your next task, suppose we wish to count how many distinct case-insensitive artist strings are in the dataset (across

image text in transcribed
Exercise 1: count_artist_strings (1 point) For your next task, suppose we wish to count how many distinct case-insensitive artist strings are in the dataset (across all users and playlists). By distinct case-insensitive," we mean two strings a and b would be requer, after conversion to lowercase, they are equal in the Python sense of a = b. For example, we would treat Jay-2' and 'JAY-Z' as equal, but we would regard Jay-Z' (with a hyphen) and 'Say 2' (without a hyphen) as unequal In a subsequent exercise, we will try to normalize names in a different way, Your task. Given a use ployint dataset, users, complete the function count_artist_strings (users) below so that I count the number of distinct case- Insensitive artist strings contained in users. For example, recall the demo dataset from Exercise 0: In [395) pprint(exe_demo_users) I playlists': (('name' Starred "tracks" [('artist: Andr Rieu 'title''Once Upon A Time In The West Main STitle Theme ("artist Andr Rieu "title: The Second wat Fron Eyes Wide Shut!). user id t8435917bd09dcelaff62b76co ('playlists : [name "Liked from Radio "tracks artist The Polide itle Every Breath Yeu To f'artist Lucie Battista title Per una lire (artist Alicia Keys ft. Day-2 title Empire State of Hind 3). na Starred tracks ['artist' title With or without You 33). user_id's "c799710802004577614795591 Looking across all users and playlists, dataset has five (5) distinct artist strings Andr Rieu 'The Police 'Lucio Battisti 'Alicia Keys ft. Jay-Z', and 'U' Observe that andre appears twice, but for our tally, we would count it just once. And if the POLICE had been in the date, then it would be consider the same as the Police Note: Your function must not modify the input datas Even if your code returns a correct result, it changes the input data, the autograder will markos incorrect In 1def count artisting users) YOUR COOF HERE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

What is a businesss cost structure?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago