Open heyuqi1970 opened 3 years ago
Can you create a reproducible test case that I could run?
Hi @kmcentush
please refer to follow:
import vaex as vx
import numpy as #np
x = np.array(['2016-01-04T00:00:00.000000000', '2016-01-04T00:00:00.000000000','2016-01-04T00:00:00.000000000','2017-01-04T00:00:00.000000000', '2017-01-04T00:00:00.000000000','NaT'], dtype='datetime64[ns]')
df = vx.from_arrays(x=x)
df.x.max()
Out[6]: array('NaT', dtype='datetime64[ns]')
df.x.minmax()
Out[7]:
array([ 'NaT', '2017-01-04T00:00:26.230259712'],
[dtype='datetime64[ns]')]
df.x.min()
Out[8]: array('2016-01-04T00:00:00.000000000', dtype='datetime64[ns]')
Hi @heyuqi1970 I tried your example on a numpy array (just x, not df.x) and its behaviour is the same. Probably @maartenbreddels should decide if the behaviour should be kept or changed.
As a temporary solution, you can filter the data only to existing values (non nat values) and only then perform the max
operation.
I use max() on datetime type column, it return 'NaT'.
Software information
import vaex; vaex.__version__)
: {'vaex': '4.1.0', 'vaex-core': '4.1.0', 'vaex-viz': '0.5.0', 'vaex-hdf5': '0.7.0', 'vaex-server': '0.4.0', 'vaex-astro': '0.8.0', 'vaex-ui': '0.3.0', 'vaex-jupyter': '0.6.0', 'vaex-ml': '0.11.1', 'vaex-graphql': '0.2.0'}