Skip to content

[Python] - Support show function for DataFrame api of python library#942

Merged
houqp merged 2 commits intoapache:masterfrom
francis-du:py_df_show
Aug 30, 2021
Merged

[Python] - Support show function for DataFrame api of python library#942
houqp merged 2 commits intoapache:masterfrom
francis-du:py_df_show

Conversation

@francis-du
Copy link
Copy Markdown
Contributor

@francis-du francis-du commented Aug 25, 2021

Which issue does this PR close?

Closes #941

Rationale for this change

What changes are included in this PR?

Add show function for DataFrame api of python library

Are there any user-facing changes?

Users can directly print the query results by calling the show function.

import pyarrow as pa
from datafusion import ExecutionContext

ctx = ExecutionContext()

batch = pa.RecordBatch.from_arrays(
    [pa.array([1, 2, 3]), pa.array([4, 5, 6])],
    names=["a", "b"],
)

df = ctx.create_dataframe([[batch]])
df.show(10)

Result

+---+---+
| a | b |
+---+---+
| 1 | 4 |
| 2 | 5 |
| 3 | 6 |
+---+---+

Comment thread python/src/dataframe.rs
Co-authored-by: Andy Grove <andygrove73@gmail.com>
Copy link
Copy Markdown
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@houqp houqp added the enhancement New feature or request label Aug 30, 2021
@houqp houqp merged commit 775477f into apache:master Aug 30, 2021
H0TB0X420 pushed a commit to H0TB0X420/datafusion that referenced this pull request Oct 7, 2025
* Add list_cat, list_concat

* Add list_repeat

* docs: add examples for list_cat, list_concat, and list_repeat functions

* Amend list_repeat code example - literal

* Amend list_ to array_ in documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] - Support show function for DataFrame api of python library

3 participants