-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE-REQUEST] Datetime date
object are output by vaex, but cannot be used as input?
#1906
Comments
Hey! So this is not a problem of vaex actually.. that is how numpy works. import numpy as np
x = np.array(np.datetime64('2020-11-11')) # all numpy right?
# but now..
x.item() # returns datetime.date() Having said that, your way of getting the max i think is very inefficient. Keep in mind - avoid Consider this example: import vaex
df = vaex.from_arrays(fnames=['topic1-2021-03-01.zip','topic1-2021-03-02.zip', 'topic1-2021-03-03.zip'])
date_array = df.fnames.str.lstrip('topic1-').str.rstrip('.zip').astype('datetime64') # Converting to proper time format
max_date = np.datetime64(date_array.max().item(), 'ns') # From there get the max, and get it into a numpy format The above i believe should be faster. Does this help? Notes:
|
Dear Jovan, PS: yes, I will take into account your notes as well, but the 1 and 2 are difficult, It is often either one or the other, but the right balance in-between is difficult. I find this could nearly been said subjective to every people. But, yes, ok, I will try to be more concise next time! |
the issue here seems to be that we don't support Python datetime objects, which I think we should. But even without the .item(), the filter doesn't seem to work. I think we should translate this to unittests, and fix them! Anyone wants to take a look at how we can add to |
Closed via #1921 |
Description
In this 'exercise', I am filtering a list of data files based on the date available in the file names. The date used for the filtering is actually obtained as the max date from another file list.
I am taking this filtering date from vaex, and vaex outputs it as a
datetime
date
object. Ok, no specific requirement from me.I would like then to re-use it for the filtering, but this time, vaex does not accept it.
Should this be expected?
So far, so good.
So far... not so good now...
So, is this to be expected?
I would expect
item()
to provide me data in a format I can re-use withinvaex
world.Additional context
As a workaround, I can turn
max_date
into anumpy
datetime64
, which is what I will use for now.So maybe
item()
should output data innumpy
format?Thanks in advance for any feedback!
Bests
The text was updated successfully, but these errors were encountered: