How to retrieve value from 0d array? (obtained with max()
)
#1699
-
Hi, import vaex as vx
li = [1, 199, 79]
vdf = vx.from_arrays(id = li)
max_id = vdf['id'].max()[0]
Traceback (most recent call last):
File "<ipython-input-15-2c73f0975c81>", line 4, in <module>
max_id = vdf['id'].max()[0]
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed Please, what is the 'right' way of doing? I can see it works by 'forcing' the array to max_id = int(vdf['id'].max()) Any advice is welcome! :) |
Beta Was this translation helpful? Give feedback.
Answered by
JovanVeljanoski
Nov 13, 2021
Replies: 1 comment 1 reply
-
Yeah, this is just df["my_column"].max().item() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yohplala
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, this is just
numpy
stuff. You can do what you want with.item()
. Like this