Advertisement
makispaiktis

Kaggle - Exercise 3 - Barplots and Heatmaps

Jul 1st, 2023
1,367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. import pandas as pd
  2. pd.plotting.register_matplotlib_converters()
  3. import matplotlib.pyplot as plt
  4. # %matplotlib inline
  5. import seaborn as sns
  6. print("Setup Complete")
  7.  
  8.  
  9. # 1. Read the data
  10. ign_filepath = "../input/ign_scores.csv"
  11. ign_data = pd.read_csv(ign_filepath, index_col="Platform")
  12. print(list(ign_data.columns))
  13. print(ign_data.head())
  14. print(ign_data.describe())
  15.  
  16. print(ign_data)
  17. # What is the highest average score received by PC games, for any genre?
  18. high_score = 7.759930
  19. # On the PS Vita platform, which genre has the lowest average score? Put your answer in single quotes
  20. worst_genre = 'Simulation'
  21.  
  22. # 2. Bar Chart and Heatmap
  23. # Bar chart showing average score for racing games by platform
  24. sns.barplot(x=ign_data.index, y=ign_data['Racing'])
  25. sns.heatmap(data=ign_data, annot=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement