I have a dataframe (df below) and i want to convert it to an numpy array. the variable mjd takes 1065 unique values and i was trying to get an array for each object_id all the flux corresponding to the different values of Mjd. thanks in advance for the help !
df.head()
Object_id    Mjd     flux         passband   
  615        59750   -544.81         0
  615        59750   -574.80         1
  615        59750    54             2
  615        59750    -44.810303     3
  615        59750    644.810303     4
Output : object_id X flux(mjd)
   array[(615,passband = 1, flux(mjd1), flux(mjd2)..flux(mjd1065)),
    (615,passband = 2, flux(mjd1), flux(mjd2)..flux(mjd1065))
    (615,passband = 3, NaN, flux(mjd2)..NaN)..
    (4512,passband = 4, flux(mjd1), flux(mjd2)..flux(mjd1065))]
if no flux for the corresponding Mjd, NaN is inserted.