I have a pandas dataframe as below:
Well Name | READTIME | WL | |
---|---|---|---|
0 | A | 02-Jul-20 | 12 |
1 | B | 03-Aug-22 | 18 |
2 | C | 05-Jul-21 | 14 |
3 | A | 03-May-21 | 16 |
4 | B | 01-Jan-19 | 19 |
5 | C | 12-Dec-20 | 20 |
6 | D | 14-Nov-21 | 14 |
7 | A | 01-Mar-22 | 17 |
8 | B | 15-Feb-21 | 11 |
9 | C | 10-Oct-20 | 10 |
10 | D | 14-Sep-21 | 5 |
groupByName = df.groupby(['Well Name', 'READTIME'])
After grouping them by 'Well Name' and Readtime, i got the following:
Well Name READTIME WL
A 2020-07-02 12
2021-05-03 16
2022-03-01 17
B 2019-01-01 19
2021-02-15 11
2022-08-03 18
C 2020-10-10 10
2020-12-12 20
2021-07-05 14
D 2021-09-14 5
2021-11-14 14
I have got the following graph by running this code:
sns.relplot(data=df, x="READTIME", y="WL", hue="Well Name",kind="line", height=4, aspect=3)
I want to have a separate graph for each "Well Name" and saved it as a pdf. I will really appreciate your help with this. Thank you