Hi Everyone
I have a dataset that looks like this
id date Var
1 1 2
1 2 2
1 3 0
2 1 4
2 2 5
2 3 5
2 4 0
2 4 0
etc
I would like the zero values in the Var column to be replaced with the last non-zero value by id group, so my data should look like:
id date Var
1 1 2
1 2 2
1 3 2
2 1 4
2 2 5
2 3 5
2 4 5
2 4 5
Thank you in advance
Costas
I have a dataset that looks like this
id date Var
1 1 2
1 2 2
1 3 0
2 1 4
2 2 5
2 3 5
2 4 0
2 4 0
etc
I would like the zero values in the Var column to be replaced with the last non-zero value by id group, so my data should look like:
id date Var
1 1 2
1 2 2
1 3 2
2 1 4
2 2 5
2 3 5
2 4 5
2 4 5
Thank you in advance
Costas
Comment