From dev-return-15059-archive-asf-public=cust-asf.ponee.io@arrow.apache.org Tue Oct 1 10:08:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7EFC4180608 for ; Tue, 1 Oct 2019 12:08:04 +0200 (CEST) Received: (qmail 7378 invoked by uid 500); 1 Oct 2019 10:08:02 -0000 Mailing-List: contact dev-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list dev@arrow.apache.org Received: (qmail 7252 invoked by uid 99); 1 Oct 2019 10:08:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2019 10:08:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A65C2E3069 for ; Tue, 1 Oct 2019 10:08:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 4D886780880 for ; Tue, 1 Oct 2019 10:08:00 +0000 (UTC) Date: Tue, 1 Oct 2019 10:08:00 +0000 (UTC) From: "Joris Van den Bossche (Jira)" To: dev@arrow.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (ARROW-6749) [Python] Conversion of non-ns timestamp array to numpy gives wrong values MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Joris Van den Bossche created ARROW-6749: -------------------------------------------- Summary: [Python] Conversion of non-ns timestamp array to numpy gives wrong values Key: ARROW-6749 URL: https://issues.apache.org/jira/browse/ARROW-6749 Project: Apache Arrow Issue Type: Bug Components: Python Reporter: Joris Van den Bossche {code} In [25]: np_arr = np.arange("2012-01-01", "2012-01-06", int(1e6)*60*60*24, dtype="datetime64[us]") In [26]: np_arr Out[26]: array(['2012-01-01T00:00:00.000000', '2012-01-02T00:00:00.000000', '2012-01-03T00:00:00.000000', '2012-01-04T00:00:00.000000', '2012-01-05T00:00:00.000000'], dtype='datetime64[us]') In [27]: arr = pa.array(np_arr) In [28]: arr Out[28]: [ 2012-01-01 00:00:00.000000, 2012-01-02 00:00:00.000000, 2012-01-03 00:00:00.000000, 2012-01-04 00:00:00.000000, 2012-01-05 00:00:00.000000 ] In [29]: arr.type Out[29]: TimestampType(timestamp[us]) In [30]: arr.to_numpy() Out[30]: array(['1970-01-16T08:09:36.000000000', '1970-01-16T08:11:02.400000000', '1970-01-16T08:12:28.800000000', '1970-01-16T08:13:55.200000000', '1970-01-16T08:15:21.600000000'], dtype='datetime64[ns]') {code} So it seems to simply interpret the integer microsecond values as nanoseconds when converting to numpy. -- This message was sent by Atlassian Jira (v8.3.4#803005)