I'm using Python and when using the following code
df['timestamp'] = df.groupby(["id"]).timestamp.transform(np.ptp)
I'm getting the warning FutureWarning: Method .ptp is deprecated and will be removed in a future version. Use numpy.ptp instead.
. df
is a Pandas DataFrame and timestamp
and id are columns
. I think np.ptp
is causing this warning.
What do I have to change?