In [1]:
%matplotlib inline
from collections import Counter
import pandas as pd
In [2]:
from IPython.core.display import HTML
css = open('table.css').read() + open('notebook.css').read()
HTML('<style>{}</style>'.format(css))
Out[2]:
In [3]:
video_games = pd.read_json("videogames.json")
video_games.head(5)
Out[3]:
In [4]:
len(video_games)
Out[4]:
In [5]:
video_games["brand"].value_counts().nlargest(5)
Out[5]:
In [6]:
len(video_games[video_games.title.isnull()])
Out[6]:
In [7]:
video_games = video_games[~video_games.title.isnull()]
In [8]:
video_games = video_games.dropna(subset=["title"])
In [9]:
list_of_category_lists = video_games.categories.sum()
len(set(x for l in list_of_category_lists for x in l))
Out[9]:
In [10]:
counter = Counter()
video_games.categories.apply(lambda x: Counter(x[0])).sum().most_common(5)
Out[10]:
In [11]:
video_games.loc[video_games['price'].idxmax()]
Out[11]:
In [12]:
video_games.loc[video_games['price'].idxmin()]
Out[12]:
In [13]:
video_games[video_games['title'].str.lower().str.contains("age of")]
Out[13]:
In [14]:
video_games["price"].mean()
Out[14]:
In [15]:
video_games["price_in_euro"] = video_games["price"] * 0.85
video_games["price_in_euro"].head()
Out[15]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: