Skip to content

Commit cb03e93

Browse files
authored
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.
1 parent b5c78b0 commit cb03e93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/en/tutorials/structured_data/time_series.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
},
399399
"outputs": [],
400400
"source": [
401-
"timestamp_s = date_time.map(datetime.datetime.timestamp)"
401+
"timestamp_s = date_time.map(pd.Timestamp.timestamp)"
402402
]
403403
},
404404
{

0 commit comments

Comments
 (0)