-
Notifications
You must be signed in to change notification settings - Fork 10
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
Clay should come with more clay out the box #11
Comments
I know legitimately this issue could just as easily be lodged with Clerk, but if clay is written as the glue layer that connects everything, it makes sense that for adoption it is here 😄 |
Thanks, @dmg46664. That is very helpful. Indeed tech.ml.dataset (also conveniently wrapped by Tablecloth) makes it a bit easier to handle such date-time situations. With Tablecloth, given a file data.csv
you could conveniently create a dataset with a datetime column as follows: (require [tablecloth.api :as tc])
(-> "/tmp/data.csv"
(tc/dataset
{:parser-fn {"x" [:local-date-time "dd/MM/yyyy HH:mm"]}})) or, if you have to have keyword column names: (-> "/tmp/data.csv"
(tc/dataset
{:key-fn keyword
:parser-fn {:x [:local-date-time "dd/MM/yyyy HH:mm"]}})) This will render nicely in Clay if you include Is it making sense for your use case? I think you are so right, that a cookbook for such examples is very much needed. There is a new cookbook project initiated by @kiramclean that was discussed in the recent visual-tools meeting, and I am very hopeful about that. Past attempts at creating cookbooks have taught us that it would not be easy to create something that would grow well and stay clear and up-to-date through time. Indeed Clay is an attempt to learn from such past experiences, at least on the tooling aspect of it. |
Thanks for the reply. Thanks for the tablecloth tip. |
@daslu Tablecloth is really excellent thanks! 🙏 |
It would be great if clay came with more opinions out the box, like in the examples it would be great if it had a date example.
First thing I did to clean up my dataset was 30 minutes working out:
I had previously read https://nextjournal.com/schmudde/java-time
but there was no format example there (edit: there was, just missed it on scan), so copy that in and work out
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
Couldn't find any date examples searching in Clerk and Clerk demos code.
I would much rather have looked at some similar examples in clay and copy and pasted to solve my problem.
Although I would prefer it all bundled in clay (one dependency), I don't mind if it is separated, as long as it's easy to plonk in without much reading. I don't do data analysis enough, so that every time I make a new notebook, it's usually some such similar chore.
Perhaps there is a better way... using techml perhaps? But I'll reach for what's available, so this ticket suggests making more clay easily available.
The text was updated successfully, but these errors were encountered: