I have a dataframe of observations, which looks like (indexes are mixed up after sorting the dataset by date):
date depth temp salt
25799 1962-10-25 08:00:00 -242.34 5.470 12.900
25798 1962-10-25 08:00:00 -227.19 5.460 12.840
25797 1962-10-25 08:00:00 -201.93 5.500 12.750
25796 1962-10-25 08:00:00 -176.68 5.530 12.610
25795 1962-10-25 08:00:00 -151.43 5.500 12.370
... ... ... ...
21617 2019-02-06 07:59:00 -20.00 3.780 7.532
21616 2019-02-06 07:59:00 -15.40 3.771 7.531
21615 2019-02-06 07:59:00 -10.00 3.759 7.529
21614 2019-02-06 07:59:00 -5.40 3.747 7.528
21613 2019-02-06 07:59:00 -0 5.748 7.528
I need to make interpolation of temperature and salinity values to the depth levels from -230, -225, ..., -5, -0 for each date:
interp_dep = [val for val in range(-230, 5, 5)]
The method described in the topic Python Pandas interpolate with new x-axis doesn't work for me, as I don't consider indexes. The interpolation within a groupby described in Pandas interpolate within a groupby is not suitable, as I need to interpolate the values by group of date, but to the new depth values. I am sort of confused, how to deal with this. Appreciate any help.