Marketing Data Analysis using Python Pandas and Plotly

import numpy as np
from numpy import isnan
import pandas as pd
from sklearn.impute import KNNImputer
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
import plotly.graph_objs as go
import plotly.express as px
from scipy.stats import shapiro
from scipy.stats import chi2_contingency
from scipy.stats import chi2
import scipy.stats as stats
from numpy import median
from numpy import std
from IPython.display import Image
import warnings
warnings.filterwarnings('ignore')
dataset = pd.read_csv('marketing_data.csv')
dataset.head()
IDYear_BirthEducationMarital_StatusIncomeKidhomeTeenhomeDt_CustomerRecencyMntWinesNumStorePurchasesNumWebVisitsMonthAcceptedCmp3AcceptedCmp4AcceptedCmp5AcceptedCmp1AcceptedCmp2ResponseComplainCountry
018261970GraduationDivorced84,835.00006/16/140189610000010SP
111961GraduationSingle57,091.00006/15/140464750000110CA
2104761958GraduationMarried67,267.00015/13/140134520000000US
313861967GraduationTogether32,474.001105-11-2014010270000000AUS
453711989GraduationSingle21,474.001004-08-201406271000010SP
dataset.rename(columns = {' Income ' :'Income'}, inplace = True) # Rename the column
dataset['Income'] = dataset['Income'].str.replace(',', '')
dataset['Income'] = dataset['Income'].astype(float)

Leave a Comment