I have the following data as part of a Pandas DataFrame, df::
qsoName,filterID,aperMag
0 PSOJ000,3,+19.284586
1 PSOJ007,2,+20.334393
2 PSOJ007,3,+20.226970
3 PSOJ007,4,+20.288778
4 PSOJ007,5,+20.189209
5 PSOJ011,2,+21.037594
6 PSOJ011,4,+20.642813
7 PSOJ011,5,+20.760576
and I'd like to pick out the different values of df['aperMag']
for the one value of df['qsoName']
, with -999.99999 being a default, e.g.
PSOJ000,-999.99999,+19.284586,-999.99999,-999.99999
PSOJ007,+20.334393,+20.226970,+20.288778,+20.189209
PSOJ011,+21.037594,-999.99999,+20.642813,+20.760576
This feels like df["qsoName"].duplicated()
should work, but the reformatting of the DataFrame is the other key part.