<jupyter_start><jupyter_text>Spotify Prediction<jupyter_code># import all the required libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
from scipy import stats
log_mini = pd.read_csv('H:/Internship/kaggle/Technocolabs/log_mini.csv')
log_mini
log_mini.head(5)
log_mini.tail(5)
log_mini.shape
log_mini.columns
log_mini.dtypes
log_mini.describe()
log_mini.nunique()
log_mini['date'].unique()
log_mini['context_switch'].unique()<jupyter_output><empty_output><jupyter_text>Cleaning the data - No Null values inside this so we can see next part Redundant Data<jupyter_code>log_mini.isnull().sum()
# Corelation matrix
corelation = log_mini.corr()
sns.heatmap(corelation, xticklabels = corelation.columns, yticklabels = corelation.columns, annot = True)
# Pairplot - Visulaize only Two varibles, Varibles- Continuous Catergorical or Booleans
sns.pairplot(log_mini)
# Scatter Plot - relationship b/w two variables - Pending(need to do)
sns.relplot(x = 'skip_2', y = 'not_skipped', data = log_mini)
# Histogram - groups to ranges so taller bar show more data range fall in that
sns.distplot(log_mini['context_switch'],  bins = 5)
tf_mini = pd.read_csv('H:/Internship/kaggle/Technocolabs/tf_mini.csv')
tf_mini.head(5)
df = pd.merge(log_mini, tf_mini, left_on = 'track_id_clean', right_on = 'track_id')
df.head(5)
# how many catergories are there in columns
for col in df.columns:
    print(col, ':', len(df[col].unique()), 'labels')
pd.get_dummies(df, drop_first = True).shape
df2 = pd.get_dummies(df,columns=['context_type','hist_user_behavior_reason_start','hist_user_behavior_reason_end'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11520190023752969, 'fraction_numerical': 0.004156769596199525, 'mean_word_length': 6.764976958525345, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '128747', 'license': 'Apache-2.0', 'n_tokens_mistral': 637, 'n_tokens_neox': 597, 'n_words': 140, 'path': 'EDA.ipynb', 'repo_name': 'ShellySinha/Blueprint_Spotify', 'size': '1684'}