Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make polars dataframe display more informative #17

Open
oscar6echo opened this issue Jul 28, 2024 · 5 comments
Open

make polars dataframe display more informative #17

oscar6echo opened this issue Jul 28, 2024 · 5 comments

Comments

@oscar6echo
Copy link

Suggestion

Instead of displaying the first 50 rows of the df, maybe :

  • display the first and last n rows (without overlap)
  • importantly display the shape of the dataframe on top

This would make the deno kernel behave similarly to the python kernel.

What do you think ?

@rgbkrk
Copy link
Owner

rgbkrk commented Jul 28, 2024

Sounds great to me. While I'll take a PR for it, I tend to just use the version built directly into polars now. There's no need to use this library for display. Here's the place to make it happen:

https://github.com/pola-rs/nodejs-polars/blob/95191dfdc9abcee12dc09533aaeb608d596006e1/polars/dataframe.ts#L1925-L1936

@oscar6echo
Copy link
Author

Thx for the clarification and redirect - and the fast reply !
I brought the conversation over to this repo: pola-rs/nodejs-polars#250

Is this lib still useful to display plots (html, svg) ? I know it is as I have used it here for example.
But would you recommend something else ? some improvement ?
Is it mature ? If so any plan to publish to jsr ? or npmjs ?

@rgbkrk
Copy link
Owner

rgbkrk commented Jul 29, 2024

I think most everything from in this repo has moved into Deno.jupyter.display directly so that it isn't needed anymore. I'm going to have to double check, but I just use the built in stuff now.

@oscar6echo
Copy link
Author

I think most everything from in this repo has moved into Deno.jupyter.display directly so that it isn't needed anymore.

Indeed, this is what it seems, from my trials.

@oscar6echo
Copy link
Author

For reference in case somebody follows the same train of thought, I found that:

The default display of a TS object, presumably using a default [Symbol.for('jupyter.display')](), is still quite obscure.

In the case of this example:
image

I observed that:

  • no mimetype among those officially listed renders the object as as the absence of [Symbol.for('jupyter.display')]()
  • using Deno.jupyter.broadcast inside [Symbol.for('jupyter.display')]() works partially (it does display the result but then returns an error 🤔 )

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants