text_plain_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df_profile = pd.read_csv('/kaggle/input/a360-internship-practice/Profile.csv')

df_location = pd.read_csv('/kaggle/input/a360-internship-practice/Location.csv')

df_content = pd.read_csv('/kaggle/input/a360-internship-practice/Content.csv')

df_rtypes = pd.read_csv('/kaggle/input/a360-internship-practice/ReactionTypes.csv')

df_react = pd.read_csv('/kaggle/input/a360-internship-practice/Reactions.csv')

df_session = pd.read_csv('/kaggle/input/a360-internship-practice/Session.csv')

df_user = pd.read_csv('/kaggle/input/a360-internship-practice/User.csv')

df_react['Datetime'] = pd.to_datetime(df_react['Datetime'])

df_content = df_content.drop(['Unnamed: 0'], axis=1)

df_react.isnull().sum()

df_react = df_react.dropna()

df_react_users = df_react.drop(['Unnamed: 0', 'Content ID', 'Type'], axis=1)

df_cont_score = pd.DataFrame(df_react.groupby('Content ID')['Type_score'].mean())

mode_counts = df_react.groupby('Content ID')['type_sentiment'].agg(lambda x: x.mode().iloc[0])
selected_mode = mode_counts.index[0]

df_cont_sentiment = pd.DataFrame(mode_counts)

df_cont_sentiment = df_cont_sentiment.reset_index()

df_cont_score = df_cont_score.reset_index()

df_content = pd.merge(df_content, df_cont_score, how='outer')

df_content = pd.merge(df_content, df_cont_sentiment, how='outer')

df_content.fillna(0)

df_content['type_sentiment'].value_counts()