How do I extract data from a Deephaven table?
How can I get data out of a Deephaven table and into Python objects?
Use the deephaven.numpy or deephaven.pandas module. to_numpy copies table data into a NumPy array, and to_pandas copies it into a pandas DataFrame. Both take an optional cols argument to copy only the columns you need.
Note
Both functions copy the data into memory. For large tables, use table operations such as where or view first so that only the data you need is copied.
For other ways to get data out of a table, see:
- Extract table values: read individual values, iterate over a column with a
forloop, and access values by row key. - Table iterators: loop over rows as dictionaries or tuples, one row or one chunk at a time.
deephaven.learn: gather table data into Python objects for calculations and scatter the results back into new table columns.
Note
These FAQ pages contain answers to questions about Deephaven Community Core that our users have asked in our Community Slack. If you have a question that is not in our documentation, join our Community and we'll be happy to help!