7. Doing Basic Statistics with Python
Activity 7.01: Finding Out Highly Rated Strategy Games
Solution:
- Load the
numpy
andpandas
libraries as follows:import pandas as pd import numpy as np
- Load the strategy games dataset (in the
dataset
folder of the chapter):games = pd.read_csv('../data/appstore_games.csv')
Note
You can download the dataset from the GitHub repository at https://packt.live/2O1hv2B.
- Perform all the transformations we did in the first section of the chapter. Change the names of the variables:
original_colums_dict = {x: x.lower().replace(' ','_') \ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â for x in games.columns} games.rename(columns = original_colums_dict,\ Â Â Â Â Â Â Â Â Â Â Â Â Â inplace = True)
- Set the
'id'
column asindex
:games.set_index(keys = 'id...