I am new to pandas and I would like to know how to clear data by extracting only parts of the rows. Let's say I have a data schema as follows:
column1 date key
A 2016 SB
A 2017 B
B 2015 SB
C 2014 SB
C 2014 PB
C 2015 B
C 2016 SB
how to clear the data so that for each of one column value I only retrieve the first value of two rows and ignore the rest (for example, the value of C, only 2014 SB and 2014 PB is what I get)?
column1 date key
A 2016 SB
A 2017 B
B 2015 SB
C 2014 SB
C 2014 PB
thank
source
share