Ecdfplot
An ecdfplot
represents the proportion or count of observations falling below each unique value in a dataset. Compared to a histogram or density plot, it has the advantage that each observation is visualized directly, meaning that no binning or smoothing parameters need to be adjusted.








Tarefa
Swipe to start coding
- Create the
ecdfplot
using theseaborn
library:
- Set the
x
parameter equals thebill_length_mm
; - Set the
hue
parameter equals the'island'
; - Add the
complementary
parameter; - Set the
stat
parameter equals the'count'
; - Set the palette equals the
'mako'
; - Set the data.
Solução
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import warnings
# Ignore all warnings
warnings.filterwarnings('ignore')
# Importing libraries needed
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/66ba0c8e-8422-413c-b7e1-74bd24c61656/penguins.csv')
# Create a ecdfplot
sns.ecdfplot(# Set the x
x = 'bill_length_mm',
# Set the hue
hue = 'island',
# Set the complementary
complementary = True,
# Set the stat
stat = 'count',
# Set the palette
palette = 'mako',
# Set the data
data = df)
# Displaying the plot
plt.show()
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 4
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import warnings
# Ignore all warnings
warnings.filterwarnings('ignore')
# Importing libraries needed
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/66ba0c8e-8422-413c-b7e1-74bd24c61656/penguins.csv')
# Create a ecdfplot
___(# Set the x
___,
# Set the hue
___,
# Set the complementary
complementary = ___,
# Set the stat
stat = ___,
# Set the palette
___,
# Set the data
___)
# Displaying the plot
plt.show()
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo