Skip to content

How to access single cell value in Daft way? #3979

Discussion options

You must be logged in to vote

I think the most efficient way would be to use to_arrow and extract the cell that way

df = daft.from_pydict({"id": [1,2,3]});
df.to_arrow()["id"][1].as_py() # 2

you can also use to_pydict or to_pylist depending on if you want columnar (pydict) or row (pylist). pydict will be faster as it's closer to our in memory representation

df.to_pydict()['id'][1] # 2
df.to_pylist()[1]['id'] # 2

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hongbo-miao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants