<jupyter_start><jupyter_text>reading the datasets<jupyter_code>cx_df = pd.read_excel('./TrainData/Customerdata_Train.xlsx')
cx_df.head()
cx_df.info(), cx_df.shape
email_data = pd.read_excel('./TrainData/Emaildata_Train.xlsx')
email_data.head()
email_data.info(), email_data.shape
train_df = pd.read_excel('./TrainData/Train.xlsx')
train_df.head()
train_df.info(), train_df.shape
transaction_df = pd.read_excel("./TrainData/transactionsdata_Train.xlsx")
transaction_df.head()
transaction_df.info(), transaction_df.shape
len(cx_df.CustomerID.unique())
len(email_data.CustomerID.unique())
len(transaction_df.CustomerID.unique())
pd.to_datetime(email_data.DateOfemail, infer_datetime_format=True)
email_data['DateOfEmail'] = email_data.DateOfemail + ' ' + email_data.timestamp
dt_email = pd.to_datetime(email_data.DateOfEmail, infer_datetime_format=True)
email_data['DateOfEmail'] = dt_email
email_data.info()
email_data.head()
email_data.drop(['DateOfemail','timestamp'],axis=1,inplace=True)
email_data.head()
transaction_df.head()
transaction_df['DateOfOrders'] = transaction_df.DateOfOrder + " " + transaction_df.timestamp
dt_trasac = pd.to_datetime(transaction_df.DateOfOrders, infer_datetime_format=True)
transaction_df['DateOfOrders'] = dt_trasac
transaction_df.drop(['DateOfOrder','timestamp'],axis = 1, inplace=True)
transaction_df.head()
email_data.MailClicked.value_counts()
email_data.groupby(by='CustomerID').agg({'EmailType': pd.Series.mode,'MailOpened': pd.Series.mode,'MailClicked': pd.Series.mode})
email_data['EmailType'].value_counts()
transaction_df.head()
transaction_df['Day_of_week'] = transaction_df['DateOfOrders'].dt.day()
transaction_df.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14926253687315635, 'fraction_numerical': 0.0011799410029498525, 'mean_word_length': 10.157894736842104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '375647', 'license': 'MIT', 'n_tokens_mistral': 605, 'n_tokens_neox': 594, 'n_words': 62, 'path': '.ipynb_checkpoints/Customer_data-checkpoint.ipynb', 'repo_name': 'Shubham654/Churn_DataAnalysis', 'size': '1695'}