diff --git a/.DS_Store b/.DS_Store index a05bdbf17207db37fd9f7d4ef9dab08547ed1654..8c4326e544aff75bdc18e95cd4563353d7bdd5eb 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/projet_en_groupe/.DS_Store b/projet_en_groupe/.DS_Store index 002561828bb5df759e0eb963818a54096c654419..f62eb354c0eca2ffb7a9666b921257d47fa7d7e2 100644 Binary files a/projet_en_groupe/.DS_Store and b/projet_en_groupe/.DS_Store differ diff --git a/projet_en_groupe/algorithme_netflix.py b/projet_en_groupe/algorithme_netflix.py index aef7da961f1648db1beefe98e668117111179e63..fb3c724f8d20587c592059673bba6dc51ee0aee1 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 Binary files a/~$Data_Base.xlsx and /dev/null differ