matplotlib
import pandas as pd # Sample data data = { 'name': ['Alice', 'Bob', 'Charlie', 'David'], 'age': [25, 30, 35, 40], 'score': [90, 80, 85, 95] }
# Create DataFrame df = pd.DataFrame(data) # Filter data: Get students with score > 85 filtered_df = df[df['score'] > 85] print(filtered_df)
# Sort by score sorted_df = df.sort_values(by='score', ascending=False) print(sorted_df)
# Group by age and calculate the average score grouped_df = df.groupby('age')['score'].mean() print(grouped_df)
import matplotlib.pyplot as plt # Simple bar chart for scores plt.bar(df['name'], df['score']) plt.title('Student Scores') plt.xlabel('Student') plt.ylabel('Score') plt.show()