So I have a .csv file with a bunch of movie titles, and one of the columns is the listing on Netflix, and it is a list so it has multiple listings, it looks like the spreadsheet below:
I have managed to extract the individual columns that I need, and so now my main trouble is how to simplify the list of genres so that repeats aren't added.
I have the following code:
enter code ef getUniqueGenres(genrelist):
uniqueGenres = []
for titles in genrelist:
for listing in titles
if not listing in uniqueGenres:
uniqueGenres.append(listing)
return uniqueGenreshere
I want the code to be able to go through each listing per title and see if it is a unique genre. If it is, it will store it, otherwise it just ignores it.
CLARIFICATION: The listed_in data colum is a list where each index is its own list. So the unique values would have to take all that into account. I tried doing something like this:
uniqueGenres = []
for titles in netflixgenre:
for listing in titles:
if not listing in uniqueGenres:
uniqueGenres.append(listing)
But that also did not give me the desired output