text_plain_output_5.png text_plain_output_9.png text_plain_output_4.png image_output_5.png text_plain_output_10.png text_plain_output_6.png image_output_7.png text_plain_output_3.png image_output_4.png text_plain_output_7.png image_output_8.png text_plain_output_8.png image_output_6.png text_plain_output_2.png text_plain_output_1.png image_output_3.png image_output_2.png image_output_1.png image_output_10.png image_output_9.png
from scipy.stats import skew

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

data = pd.read_csv('../input/online_shoppers_intention.csv')
data.shape

data.describe().T

data.columns = ['admin_pages', 'admin_duration', 'info_pages', 'info_duration', 'product_pages', 'prod_duration', 'avg_bounce_rate', 'avg_exit_rate', 'avg_page_value', 'spl_day', 'month', 'os', 'browser', 'region', 'traffic_type', 'visitor_type', 'weekend', 'revenue']

data1 = data.copy()

data1.weekend = np.where(data.weekend == True, 1, 0)
data1.revenue = np.where(data.revenue == True, 1, 0)

data.month.unique()

cat = ['admin_pages', 'info_pages', 'spl_day', 'month', 'os', 'browser', 'region', 'traffic_type', 'visitor_type', 'weekend']
cont = ['admin_duration', 'info_duration', 'product_pages', 'prod_duration', 'avg_bounce_rate', 'avg_exit_rate', 'avg_page_value']

mask = np.array(data1[cont].corr())
mask[np.tril_indices_from(data1[cont].corr())] = False

def cat_data(i):
    pass
for i in cat:
    cat_data(i)

from scipy.stats import skew
sns.set()
def continous_data(i):
    pass
for i in cont:
    continous_data(i)

def cat_bivar(i):
    sns.barplot(data[i], data1.revenue)
    print('--' * 60)
    plt.title('Bar-plot of Revenue against ' + str(i))
    plt.show()
for i in cat:
    cat_bivar(i)