Closed
Description
This produces a poor warning
>>> import pandas as pd
>>> import numpy as np
>>> np.ptp(pd.Series([1, 2, 3]))
/lib/python3.7/site-packages/numpy/core/fromnumeric.py:2495: FutureWarning: Method .ptp is deprecated and will be removed in a future version. Use numpy.ptp instead.
because np.ptp
calls Series.ptp
, which is deprecated. We should instruct the user
to convert the Series to an array before calling ptp
.
np.ptp(pd.Series([1, 2, 3]).array)
The warning is defined at
Lines 10197 to 10199 in 20e4c18
In this case I am using numpy ptp, however the error messages states I am not
>>> dfagg = df.groupby(['idf']).agg({ 'f1' : [np.min, np.max, np.ptp] })
C:\test\lib\numpy\core\fromnumeric.py:2495: FutureWarning: Method .ptp is deprecated and will be removed in a future version. Use numpy.ptp instead.
NO warning
>>> dfagg = df.groupby(['idf']).agg({ 'f1' : [np.min, np.max, numpy.ptp] })