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

group-by a date column results in numerical group names #165

Open
daslu opened this issue Aug 29, 2024 · 0 comments
Open

group-by a date column results in numerical group names #165

daslu opened this issue Aug 29, 2024 · 0 comments
Assignees

Comments

@daslu
Copy link
Member

daslu commented Aug 29, 2024

Zulip discussion:
https://clojurians.zulipchat.com/#narrow/stream/151763-beginners/topic/datetime.20problem.20in.20tablecloth.20group-by

Here is a self-contained example.
Create the file d.csv as follows:

date,x
2021-01-01,1
2021-01-02,2

Then:

(require '[tablecloth.api :as tc])

(-> "d.csv"
    (tc/dataset {:key-fn keyword})
    (tc/group-by :date))

_unnamed [2 3]:

| :name | :group-id |               :data |
|------:|----------:|---------------------|
| 18628 |         0 | Group: 18628 [1 2]: |
| 18629 |         1 | Group: 18629 [1 2]: |

The group names are turned into numbers.

@daslu daslu self-assigned this Oct 9, 2024
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

1 participant