I have the following dataset:
JavaScript
x
15
15
1
Count
2
Submit date Code
3
2019-09-01 1 24
4
2019-09-01 2 29
5
2019-09-01 3 11
6
2019-09-01 4 55
7
2019-09-01 5 NaN
8
2019-09-02 1 9
9
2019-09-02 2 19
10
2019-09-02 3 NaN
11
2019-09-02 4 71
12
2019-09-02 5 8
13
2019-09-03 1 5
14
15
The dataset spans three months and counts the occurrence of five codes per day.
In order to plot the data I have just used the following code:
JavaScript
1
2
1
groupeddataset['Count'].unstack().fillna(0).plot(figsize=(60,20),lw = 3, marker = "o", ms = 3)
2
I am wondering though, how this can be done using seaborn and a lineplot ?
Advertisement
Answer
Is this what you are looking for?
JavaScript
1
2
1
sns.lineplot(x='Submit date', y='Count', style='Code', data=groupeddataset.reset_index())
2