Replies: 4 comments 5 replies
-
Yeah, this is a known issue. Currently you can't shift a column that has already been shifted before. You may also get the same (or similar) issue if you try to shift a virtual column that is several "generations deep" (i.e. a virtual column created from a virtual column created from a virtual column create.. ). We are working on this, but timeline is uncertain. Maybe @maartenbreddels can comment on it more. |
Beta Was this translation helpful? Give feedback.
-
Thinking out-loud, how about: osc_data_zc[['x', 'sx','id']].export('osc_data_zc_cols.hdf5') |
Beta Was this translation helpful? Give feedback.
-
I tried the code in the last message. It failed with:
It appears that osc_data_zc is actually osc_data internally defined using a slice of osc_data |
Beta Was this translation helpful? Give feedback.
-
I finally got the following to work. I am posting it here, in case someone else wants to do something similar. Also, I have a few questions after I document the solution:
This solution is a workaround, but it leaves a "temporary file" lying around (i.e, osc_data_cols.hdf5). I would like to delete this file in the Python code, but I could not find a delete dataframe method. Am I missing something? If such a method does not exist, I wonder if the following would work? Put the code that creates the "temporary file" in a function. Return the name of the temporary file from the function. Delete the temporary file in the calling code. This should work if when exiting the function, the dataframe is deleted because it goes out of scope. Is this true? |
Beta Was this translation helpful? Give feedback.
-
I am having a problem with the shift operator on dataframes. The following code works fine:
The result is:
However, if I enable the first commented out shift statement at the end of the snippet, i.e.,
vaex throws an error I don't understand:
Since the shift call at the beginning of the snippet works, I am at a loss to understand why the shift call at the end of the snippet doesn't. This snippet abstracts code that I want to use on a dataframe with many rows. I particular, I want to copy certain columns down one place so I can do some calculations that involve the values on both rows. Can anyone give me a hand?
Beta Was this translation helpful? Give feedback.
All reactions