From 76822f45ced56417e58b624b590378eb80b76300 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 15 May 2018 17:23:19 +0200 Subject: [PATCH 1/2] Add epoch alternative to deprecation message --- pandas/_libs/tslibs/timedeltas.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 248c648c33db3..e228c0612ce7d 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1196,6 +1196,9 @@ class Timedelta(_Timedelta): msg = textwrap.dedent("""\ Floor division between integer array and Timedelta is deprecated. Use 'array // timedelta.value' instead. + If you want to obtain epochs from an array of timestamps, + you can rather use + 'array - pd.Timestamp("1970-01-01")) // pd.Timedelta('1s')'. """) warnings.warn(msg, FutureWarning) return other // self.value From 29fa897f825cf1c162b4cdb98bc4865f05d8de0b Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 15 May 2018 17:34:02 +0200 Subject: [PATCH 2/2] double quotes --- pandas/_libs/tslibs/timedeltas.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index e228c0612ce7d..d17d4e7139d72 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1198,7 +1198,7 @@ class Timedelta(_Timedelta): deprecated. Use 'array // timedelta.value' instead. If you want to obtain epochs from an array of timestamps, you can rather use - 'array - pd.Timestamp("1970-01-01")) // pd.Timedelta('1s')'. + 'array - pd.Timestamp("1970-01-01")) // pd.Timedelta("1s")'. """) warnings.warn(msg, FutureWarning) return other // self.value