Really need help for the problem as below.
This is the pseudo data table.
For three stocks, I wanna extract the data between 1 and 2. Dots are the missing values.
Note that For Stock B, 2 does not appear on the table. but we still need to select those between date 2.4 and 2.7.
I am looking for a generalized codes for performing the selection, as my real data consists of hundreds of stocks.
Thank you so much first !!!
DATE STOCK PRICE Volume first/last
1.1 A . .
1.2 A . .
1.3 A . .
1.4 A 0.5 200 1
1.5 A 0.6 1000
1.6 A . .
1.7 A 0.5 300 2
1.8 A . .
1,9 A . .
2.1 B . .
2.2 B . .
2.3 B . .
2.4 B 0.75 400 1
2.5 B 0.6 2000
2.6 B . .
2.7 B 1..5 300
3.1 C . .
3.2 C . .
3.3 C 2 5000 1
3.4 C 1.5 2000
3.5 C 2 1000
3.6 C 1.75 3000 2
3.7 C 1.8 5000