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
input_1
print(input_1)
import pandas as pd
import numpy as np
dataframe = pd.read_csv("/work/Video_Game_Sales.csv")
dataframe
Step Two - Formulate your Aggregation Function
dataframe.query("Global_Sales_M>=10").groupby(['Platform','Publisher']).count()['Year'].reset_index().sort_values(by='Year', ascending=False)
#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")