From 76a0ab2a1861179cee60b4bd79c5cd358bec6afe Mon Sep 17 00:00:00 2001 From: Adrienucl <adrien.payen@student.uclouvain.be> Date: Tue, 19 Dec 2023 14:17:37 +0100 Subject: [PATCH] last update --- .DS_Store | Bin 6148 -> 6148 bytes projet_en_groupe/.DS_Store | Bin 6148 -> 6148 bytes projet_en_groupe/algorithme_netflix.py | 34 +++++++++++++++---------- ~$Data_Base.xlsx | Bin 165 -> 0 bytes 4 files changed, 20 insertions(+), 14 deletions(-) delete mode 100644 ~$Data_Base.xlsx diff --git a/.DS_Store b/.DS_Store index a05bdbf17207db37fd9f7d4ef9dab08547ed1654..8c4326e544aff75bdc18e95cd4563353d7bdd5eb 100644 GIT binary patch delta 48 zcmZoMXffEZorQ7dWC6B99?9xzBXcty1w#W1!^u5t(v01c16bu5do~xaPGj24&heKY E0B0!<W&i*H delta 38 ucmZoMXffEZon^8BTPcUJp|OsFk)h$_UN-;9(JX?Sr?M6?ZD!;6#}5GE*9&+6 diff --git a/projet_en_groupe/.DS_Store b/projet_en_groupe/.DS_Store index 002561828bb5df759e0eb963818a54096c654419..f62eb354c0eca2ffb7a9666b921257d47fa7d7e2 100644 GIT binary patch delta 47 zcmZoMXffEZm4$KV<ZUd4+>+JRM&@QZ3Wf$2lMPvA7`rF?vC1>{Y|dky!L*s3<1aq| DYatGK delta 69 zcmZoMXffEZm4$J~<ZUd4>Jrt}#)if^3Py&8wK@vbmPQ6T3MR&8wY8iaqRRT#LGjr+ Zxq10rll@uc8M`;<v(8}J%*OGL9{}P~6z2c{ diff --git a/projet_en_groupe/algorithme_netflix.py b/projet_en_groupe/algorithme_netflix.py index aef7da9..fb3c724 100644 --- a/projet_en_groupe/algorithme_netflix.py +++ b/projet_en_groupe/algorithme_netflix.py @@ -26,11 +26,13 @@ def catalog(data_1): # Be careful, you need to ask each time if they want to save the list to a .csv -def movies(data_1): +def movies(data_1): # enregistrement films = data_1[data_1['type'] == 'Movie'] # Filter the data to include only movies movie_titles = films['title'].tolist() # Extract movie titles + # afficher que les 100 premiers + print(movie_titles) # Display movie titles save_to_csv(movie_titles) @@ -157,6 +159,7 @@ def director(data_1): director_list.append(director_name) print("List of all possible directors: ") + print(director_list) director_input = input("Enter the name of the director to display movies and/or series: ") director_data = filtered_data[filtered_data['director'].str.lower().str.contains(director_input.lower(), case=False, na=False)] @@ -165,8 +168,8 @@ def director(data_1): director_data_sorted = director_data.sort_values(by='release_year', ascending=True) # see if we do in ascending or descending - print(director_data) - save_to_csv(director_data) + print(director_data_sorted) + save_to_csv(director_data_sorted) else: print(f"No person found with the name {director_input}.") @@ -181,6 +184,7 @@ def actor(data_1): actor_list.append(actor_name) print("List of all possible actors: ") + print(actor_list) actor_input = input("Enter the name of the actor to display movies and/or series: ") actor_data = filtered_data[filtered_data['cast'].str.lower().str.contains(actor_input.lower(), case=False, na=False)] @@ -280,7 +284,7 @@ def most_rated(data_1, data_2) : def most_rated_year(data_1, data_2): # Display all available unique release years available_years = data_1['release_year'].unique() - print("Available years: ", available_years) + print("Available years: ", available_years) # tri des dates # Ask the user to enter a release year year = input("Enter a release year: ") @@ -324,7 +328,7 @@ def most_rated_recent(data_1, data_2): # Example usage -def parental_code(data_1): +def parental_code(data_1): # s5542 bug concernant les virgules code_list = [] for codes in data_1['rating'].dropna().str.split(', '): @@ -446,6 +450,7 @@ def save_to_csv(data, default_filename='output.csv'): open_choice = input("Do you want to open the saved file? (YES/NO): ").upper() if open_choice == 'YES': os.system(file_name) + else: # Prompt for a new file name new_filename = input("Enter a new file name (DO NOT include .csv extension): ") @@ -519,6 +524,7 @@ def create_category_matrix(catalog, categories): if categories[j] in movie_categories[1]: category_matrix[i + 1][j + 1] += 1 # Commencez à remplir à partir de la deuxième ligne et de la deuxième colonne # Ajoutez les noms de catégories à la première colonne et les données de la matrice + return category_matrix @@ -593,15 +599,15 @@ def recommandation_algorithm() : # Création du menu def action() : print("Here are the different options available:") - print("1. View the entire catalog") - print("2. View all movies in the catalog") - print("3. View all series") - print("4. View all series, movies or both by year") - print("5. View all series, movies or both by country") - print("6. View all series, movies or both by type") - print("7. View all series, movies or both by type sorted by duration") - print("8. View series, movies or both directed by a specific director and sorted by year") - print("9. View series, movies or both featuring a specific actor and sorted by year") + print("1. View the entire catalog") + print("2. View all movies in the catalog") + print("3. View all series") + print("4. View all series, movies or both by year") + print("5. View all series, movies or both by country") + print("6. View all series, movies or both by type") + print("7. View all series, movies or both by type sorted by duration") + print("8. View series, movies or both directed by a specific director and sorted by year") + print("9. View series, movies or both featuring a specific actor and sorted by year") print("10. View how many series, movies or both and series directed by a director in a specific genre") print("11. View how many series, movies or both an actor has played in") print("12. Display the highest-rated series, movies or both") diff --git a/~$Data_Base.xlsx b/~$Data_Base.xlsx deleted file mode 100644 index d10daf560a7f8247050905285b3e618c244966d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 165 icmZQ~OexAt%~K!|uroL^q%agQWHO{O<S{7F7y<yg{SdVP -- GitLab