From cb03e938a7d7ae8c203a1dc7059a035d0a174a37 Mon Sep 17 00:00:00 2001 From: jcjveraa <3942301+jcjveraa@users.noreply.github.com> Date: Wed, 23 Dec 2020 06:12:02 -0800 Subject: [PATCH] use Pandas timestamp instead of datetime timestamp While the pandas dataframe seems to be in UTC (my inspector shows 'Z' for zulu timezone, =UTC), Using datetime.datetime.timestamp seems to interpret the time as the local time. This results in different outputs depending on your local timezone (clearly visible in the ' Time of Day signal plot' ). Using the pandas equivalent function works uniformly independent from local environment. --- site/en/tutorials/structured_data/time_series.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/en/tutorials/structured_data/time_series.ipynb b/site/en/tutorials/structured_data/time_series.ipynb index d06ebcfeaa9..1a08a63f1ff 100644 --- a/site/en/tutorials/structured_data/time_series.ipynb +++ b/site/en/tutorials/structured_data/time_series.ipynb @@ -398,7 +398,7 @@ }, "outputs": [], "source": [ - "timestamp_s = date_time.map(datetime.datetime.timestamp)" + "timestamp_s = date_time.map(pd.Timestamp.timestamp)" ] }, {