How to do interpolation on datetime and float
问题 I am doing 1d interpolation using scipy on time-series. My x-axis data is in datetime format and y axis is in float like: 3/15/2012 16:00:00 32.94 3/16/2012 16:00:00 32.95 3/19/2012 16:00:00 32.61 Now during slope calculation slope = (y_hi-y_lo) / (x_hi-x_lo) i am getting the error TypeError: unsupported operand type(s) for /: 'float' and 'datetime.timedelta' which is an obvious error. Can someone point me toward the right direction, How to handle it ? 回答1: Your issue is that you are trying