Pre-Requisites to Understanding this Article
Replicating the IFS Family with Pandas
Now, how does Pandas Implement these functions compared to Excel? 🐼
Video Game Sales Analysis 🎮
Step One - Import your Data
import pandas as pd
import numpy as np
dataframe = pd.read_csv("/work/Video_Game_Sales.csv")
dataframe.head()
Step Two - Formulate your Aggregation Function
dataframe.query('Global_Sales_M > 10')
#Specify the Libraries Needed
import plotly.express as px
platform_df = dataframe.groupby(['Platform','Year']).sum()['Global_Sales_M'].reset_index().groupby('Platform').sum().sort_values(by=['Global_Sales_M'], ascending=False)['Global_Sales_M'].reset_index()
px.bar(platform_df, x='Platform', y='Global_Sales_M', title="Platform Sales - Macro View")
dataframe_to_analyse =dataframe.groupby(['Platform','Year']).sum()['Global_Sales_M'].reset_index().set_index('Year').reset_index().query('Global_Sales_M >50')
px.bar(dataframe_to_analyse, x="Year", y="Global_Sales_M", color="Platform", title="Distribution of Game Sales versus Platform and Year")