-
-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Ported from here pola-rs/polars#21676
Description
I came to polars from Kyle Kelley's blog post about integrating Deno and Jupyter, which specifically mentions polars as a tool to use with this setup. However, I found the docs for new javascript/deno/node users hard to follow. I'll break down a few general issues I ran into as a new user. Hopefully, these observations could help identify targets to improve upon in an effort to help adoption among JavaScript developers.
Note: I'll use the term JavaScript
generally here but consider it as a placeholder for runtimes like nodejs
and deno
.
- The User Guide does not include JavaScript examples
The nodejs-plars
page has a link to a User Guide, but that page only shows examples in Python and Rust:
Linked User Guide missing JavaScript example
It would be great if the User Guide also included JavaScript in its tutorials.
- The
nodejs-polars
docs don't list intuitive functions and methods from a user's perspective.
The first thing I looked for was information on Polars DataFrames. I clicked DataFrame
from the list on the left and it took me to this page, which seems to describe some more internal part of the polars API than a user-facing method. I expected to see something more like a guide that had some examples showing how a user would create a dataframe as well as a list of all of the methods I could do to that dataframe once it was created.
I think the page I'm looking for is this one, which I found by clicking pl
under "Namespaces" on that page and then DataFrame
under "Interfaces" on that page. This jargon is hard to follow, though.
From this page, it was still hard to find the information I wanted. For instance, it includes 406 lines of TypeScript before listing the methods available on pl.DataFrame
in human language.
I'm still a bit confused by how many of them work. For example, I see that minus
is a method:

I understand how to subtract one number from another, but what does it mean to subtract something from an entire DataFrame? This could be an opportunity to discuss how these operations work architecturally, when it would work and when it wouldn't, such as with a DataFrame of mixed-string and numeric types.
In general, these docs seem like they were auto-generated from the source code and while they may be "correct" in that sense, they aren't really human navigable, especially for users who aren't coming from a computer science or programming languages background.
For example, the docs for UnderscoreJS list each method with both type definitions, examples and human language. They link to the source so developers who want more detail can dig deeper. I'm not saying you need to follow this exact format but rather as an example of including information at various levels of detail.
- Docs could benefit from examples
After I discovered that browsing methods on the pl
object was more what I was looking for, I started reading about the readCSV
. Here's how it describes its API:

Many users aren't used to reading type annotations, though. And for those that are, it's still useful to have a simple example, similar to what is on the Python and Rust pages, showing how to use this method.
const df = readCSV('/path/to/file.csv', {/* Include some common options here */});
Thanks for all of your work in building this library. I could see it being very helpful to the JavaScript community – especially inside of Jupyter notebooks now that Deno support is there.