text_html_output_1.png
import matplotlib.pyplot as plt

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

import seaborn as sns

data = pd.read_csv('/kaggle/input/brainly/IC2 Data Analyst Taske home task - dataset for Part 2 - 2.1.csv')

data.shape

data.sort_values(by=['action_date'], inplace=True)

fig, ax = plt.subplots(figsize=(13,6))

# Add x-axis and y-axis
ax.bar(data["action_date"],
        data['daily_conversion_rate ']
        )

# Set title and labels for axes
ax.set(xlabel="Date",
       ylabel="Daily Conversion rate(%)",
       title="Daily Conversion Rate to trial")

# Rotate tick marks on x-axis
plt.setp(ax.get_xticklabels(), rotation=45)

plt.show()

data['week_number'] = pd.to_datetime(data['action_date']).dt.strftime('%U')
data['weekday'] = pd.to_datetime(data['action_date']).dt.day_name()

cats = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']

fig, ax = plt.subplots(figsize=(13,6))

# Add x-axis and y-axis
ax.bar(data["action_date"],
        data['conversion_rate_to_unlockpage ']
        )

# Set title and labels for axes
ax.set(xlabel="Date",
       ylabel="Unlock Page Conversion rate(%)",
       title="Daily Unlock Page Conversion")

# Rotate tick marks on x-axis
plt.setp(ax.get_xticklabels(), rotation=45)

plt.show()

pd.Series(data['daily_conversion_rate ']).corr(pd.Series(data['conversion_rate_to_unlockpage ']))

fig, ax = plt.subplots(figsize=(13,6))

# Set title and labels for axes
ax.set(xlabel="conversion_rate_to_unlockpage(%)",
       ylabel="daily_conversion_rate",
       title="Relationship between unlock page view rate to trial rate")

sns.scatterplot( data["conversion_rate_to_unlockpage "], data["daily_conversion_rate "]);

fig, ax = plt.subplots(figsize=(13,6))

# Set title and labels for axes
ax.set(xlabel="unlock_users",
       ylabel="trial_users",
       title="Relationship between trial users and unlock users")
sns.scatterplot(data["unlock_users"], data["trial_users"] );

data_2 = pd.read_csv('/kaggle/input/brainly-2/IC2 Data Analyst Taske home task - dataset for Part 2 - 2.2.csv')

data_2['answer_added (%)'] = data_2['users_at_least_1_answer_added'] / data_2['users_all'] * 100
fig, ax = plt.subplots(figsize=(13, 6))
ax.set(title='Behavior of converted and non converted users in answer_added')
sns.barplot(x=data_2['user_converted_to_trial'], y=data_2['answer_added (%)'])