Challenge: Plotting Hists
Oppgave
Swipe to start coding
In this task, you need to draw histograms of the 'Click'
column for the control and test samples. This is done to better understand the shape of the distribution of our data.
- Import libraries.
- Read the files.
- Plot the histograms.
Løsning
99
1
2
3
4
5
6
7
8
9
10
11
12
# Import libraries
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Read .csv files
df_control = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_control.csv', delimiter=';')
df_test = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_test.csv', delimiter=';')
# Plotting hists
sns.histplot(df_control['Click'], color="#1e2635", label="GroupA")
sns.histplot(df_test['Click'], color="#ff8a00", label="GroupB")
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 2. Kapittel 5
single
99
1
2
3
4
5
6
7
8
9
10
11
12
# Import libraries
import ___ as pd
import ___ as plt
import ___ as sns
# Read .csv files
df_control = pd.___('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_control.csv', delimiter=';')
df_test = pd.___('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_test.csv', delimiter=';')
# Plotting hists
sns___(df_control___, color="#1e2635", label="GroupA")
sns___(df_test___, color="#ff8a00", label="GroupB")
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår