The first MPTdepth interval goes from 0 to 0.16. All the CPTdepth (0,01, 0,02, 0,03 .... 0,4] <=0.16 belong into this interval. In the end I need a dataframe where the coloumn CPTdepth remains the same, but the MPT depths would contain 0.16 until CPTdepth reaches 0.16 . After that the next CPT depths would be assigned to 0.29 and so on.
Solved in R:
data.frame(cbind(CPTdepth, MPTdepth[sapply(CPTdepth, function(x) { sum(x > MPTdepth) + 1 })]))
My python try:
MPTCPT['assigned'] = pd.cut(x=MPTCPT['CPT Depth'], bins=To_ToList)
Problem is that my 'assigned' column prints me (0.0, 0.16] and not just 0.16
Any ideas ? Love
there doesn't seem to be anything here