Hello everyone,
I have a very large dataset, in which each unique id has multiple columns (different codes) and different dates. I'm trying to figure out a way to extract ids with desired codes and their oldest dates, and then calculate the time difference between codes for each id, and I'm lost
any suggestions on how should I do it? I'd really appreciate your help.
a small sample of my dataset:
id code date
I have a very large dataset, in which each unique id has multiple columns (different codes) and different dates. I'm trying to figure out a way to extract ids with desired codes and their oldest dates, and then calculate the time difference between codes for each id, and I'm lost

a small sample of my dataset:
id code date
1 | 00190 | 20160204 |
1 | 00300 | 20180110 |
1 | 00670 | 20160114 |
1 | 01420 | 20160115 |
1 | 01480 | 20160419 |
1 | 13132 | 20160108 |
1 | 13132 | 20180110 |
1 | 13133 | 20160108 |
2 | 13133 | 20180110 |
2 | 00190 | 20160204 |
2 | 00300 | 20160419 |
2 | 00670 | 20160114 |
2 | 01420 | 20160114 |
2 | 01480 | 20160114 |
2 | 13132 | 20160114 |
2 | 13132 | 20160114 |
2 | 00670 | 20180112 |
Comment