when we have thousands of categories i wonder if we could have a different strategy? I made some heuristics to determine # of unique answers for surveys.
things like source are like 30k unique things, could maybe show different summary stats and a sampling?
whereas tags a top 20 or so with rest binned into "Other" might be nicer?
Just thinking outloud here -- hard to figure out the exact threshold (it's actually quite nice to be able to hover over 200 countries and see all the names). Also, an edge case when there is *already* a category called "Other". We could name the hover "## others...".
I really love this Summary Table!
How could we combine this with a csv autotype refiner? I mean, sometimes, a column would be unproperly "autotyped" as numeric, but it is actually a nominal variable (zip code, gender...)
I'd love a kind of intermediate "table input" listing columns, their guessed type, and offering options to refine it (like the RStudio Import dataset wizard).
This would be very useful for the Data Wrangler as well.
And also, some i18n options would be welcomed... (but i can fork the notebook to translate Summary Table in french myself, and display numbers with locale delimiters, obviously).
Thanks for your thoughts, Éric (and sorry I missed as the year was winding down). I've noticed that the Summary Table is a nice tool for surfacing *when I have a type error in my data* (e.g., I see that autotyping, and want to change it).
The table input listing columns and types is a great idea for a tiny tool -- here's a super quick one:
https://observablehq.com/@ambassadors/data-type-table
Adjusting them would be a great step to explore!
Could it be possible to support Arrow Table as input? It's not difficult to convert table to array but still it would nice to have this feature on SummaryTable. Especially because Inputs.table supports Arrow Table as input.
Thanks for the suggestion, and sorry I lost track of this thread! I've added Arrow Table support to the SummaryTable -- let me know if you have any issues! Here's an example https://observablehq.com/d/53b82a2f05a848de
Hi there!
(really interesting feature to get a quick overview)
Came across this and thought of pandas Dataframe (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) where the datatypes are infered. However if you want to "force" one you would pass the kwarg dtype. Maybe something you considered?
Thanks for the feedback! We did consider that, but leaned towards a simpler API for use, imagining that people could transform their type before passing it into the function (using the SummaryTable has actually helped me surface incorrect types!)
The mouse cursor suggests that the bars are supposed to be clickable, but nothing happens on click. I also see no related event handling in the notebook. Has this not been implemented yet?
Hi. First of all, I use the summary table in almost all my notebooks, and I really love it.
Just a simple request/suggestion: I think it would be really useful to have the numeric total (length) of every category besides of the percentage in the tooltips of categorical data.
Thank you for your awesome work!
You’ll need to do that type setting before passing it into the table- depending on how you’re loading the data, you can:
FileAttachment("path.csv").csv({ typed: true })
Or, using d3.csv:
d3.csv(“path.csv”, d3.autoType)
Note that the <style> element that you append here affects all elements on a page. <style> cannot be scoped (unless you append it to a shadowRoot). Instead you will have to add a dynamic class or ID to create a specific scope for your td rule.
I recommend to set the scope class/ID on `el`, and to migrate all inline styles into the <style> element.