This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#new revenue column | |
df['revenue'] = df.apply(lambda x: x.checkout_price*x.num_orders,axis=1) | |
#new month column | |
df['month'] = df['week'].apply(lambda x: x//4) | |
#list to store month-wise revenue | |
month=[] | |
month_order=[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
center_type_name = ['TYPE_A','TYPE_B','TYPE_C'] | |
#relation between op area and number of orders | |
op_table=pd.pivot_table(df,index='op_area',values='num_orders',aggfunc=np.sum) | |
#relation between center type and op area | |
c_type = {} | |
for i in center_type_name: | |
c_type[i] = df[df['center_type']==i].op_area |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
plt.style.use('seaborn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df_meal = pd.read_csv('C:\\Users\Dell\\Desktop\\train_food\\meal_info.csv') | |
df_meal.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df_center = pd.read_csv('C:\\Users\Dell\\Desktop\\train_food\\fulfilment_center_info.csv') | |
df_center.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train = pd.read_csv('/kaggle/input/house-prices-advanced-regression-techniques/train.csv') | |
test = pd.read_csv('/kaggle/input/house-prices-advanced-regression-techniques/test.csv') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train.info() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train['SalePrice'].describe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
sns.distplot(train['SalePrice']) | |
plt.xticks(rotation=30); |