Skip to content

Instantly share code, notes, and snippets.

View aniruddha27's full-sized avatar

Aniruddha Bhandari aniruddha27

View GitHub Profile
train['PoolQC'].unique()
import pandas as pd
import numpy as np
df = pd.read_csv(r'C:\Users\Dell\Desktop\train_big_mart.csv')
df.head()
df.info()
df.groupby('Outlet_Location_Type')
df.groupby('Outlet_Location_Type').count()
df.groupby('Outlet_Location_Type')['Item_Outlet_Sales']
df.groupby('Outlet_Location_Type')['Item_Outlet_Sales'].sum()
data = {'Gender':['m','f','f','m','f','m','m'],'Height':[172,171,169,173,170,175,178]}
df_sample = pd.DataFrame(data)
df_sample
f_filter = df_sample['Gender']=='f'
print(df_sample[f_filter])
m_filter = df_sample['Gender']=='m'
print(df_sample[m_filter])
f_avg = df_sample[f_filter]['Height'].mean()
m_avg = df_sample[m_filter]['Height'].mean()
print(f_avg,m_avg)