having just tried it, realize I'll also need to import all the tidy functions into my notebook. wonder if we should do a Tidy namespace so its like Tidy.tidy, Tidy.mutate etc
Yea, we can add the copy code button for sure -- there is also a way to just import T (T.tidy, T.mutate, etc., I just thought it was a little messy. I'm surprised that you have to import the tidy functions separately if you import this from the notebook (shouldn't they load as dependencies?). Ah, but if you want to run the code yourself, you need to import. I see... interesting problem....
In this cell I "deduplicate" the data, in this case by reducing each location to the most recent protest in that location. I can't figure out how to do this operation with the wrangler. I think I should do a groupBy(location, …return first)?
(Feel free to delete!)
the following looks correct (obtained by clicking "order"…"date"…"descending" then "dedupe"…."Location":
```
aq.from(data)
.orderby(aq.desc("Date"))
.dedupe('Location')
```
In the cell above, it would be fantastic if we could reorder the operations by dragging them, like in https://observablehq.com/@jashkenas/select-order-input
for example, if I want to reduce data to get a total by city I might add the rollup operation first (to indicate what I want as a result: "total"), then only realize I needed to group first (by city). Currently I have to undo the rollup, add grouping, then re-add rollup.
I have no idea what the regexp above is supposed to do in this context… But this test shows a case where it's failing. If we can clarify the spec (even if only with enough examples as unit tests), it will be easier to fix.
Good question! It was the suggestion of an ambassador -- to automatically prefix character strings (which are _probably_ variables) so that you can just type in "COLUMNA + COLUMNB / 2" instead of writing "d.COLUMNA + d.COLUMNB / 2". Perhaps just trying to be smart in a way that is fragile...
@Mike F thank you for this notebook and organizing the backlog of work. Things I'm thinking about for our discussion today:
- Let's discuss the backlog list, including the complexity of adding these (I'm thinking in terms of t-shirt sizing of work required)
- I'd like us to have a pre-defined process of capturing feature requests that Arquero doesn't support natively --> let's discuss
- Naming and release mechanics
Next steps:
- code review complete+updates
- figure out name
- release mechanics - release notes, date to release, release as tier 3 (same mechanics as inputs and code snippets)
Not sure if this is an easy fix, but when renaming a column after applying other transformations, it does not update the column name variable in the other transformation functions when changing the order of transformations.
Great point! We thought a lot about this, and didn't come up with a solution to propagating the changes to downstream controls that was predictable and consistent. Very much on our minds for how to do this well as we move forwards!
I imagine this can get complex real quick, so how about introducing a 'column' mode where the user can apply transformations to column offsets (including column renaming) and apply renaming after users are satisfied with their transformations? E.g. a button that converts column offsets (Col 1, Col2, etc) to named columns
Interesting idea! At this stage, we're trying to offer an interface on top of the existing API (rather than create additional functions). Thanks for the feedback!