import pandas as pd # Load the CSV file into a DataFrame df = pd.read_csv('your_file.csv') # Check if 'short description' column contains 'global protect' or 'prisma' keyword mask = df['short description'].str.contains('global protect|prisma', case=False) # Filter rows based on the mask filtered_df = df[mask] # Sort the filtered DataFrame by the 'short description' column sorted_filtered_df = filtered_df.sort_values(by='short description') # Output the sorted and filtered DataFrame print(sorted_filtered_df) # Export the sorted and filtered DataFrame to a new CSV file sorted_filtered_df.to_csv('sorted_filtered_data.csv', index=False)