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

Stats for datetimes #3007

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft

Stats for datetimes #3007

wants to merge 32 commits into from

Conversation

polinaeterna
Copy link
Contributor

No description provided.



class Histogram(TypedDict):
hist: list[int]
bin_edges: list[Union[int, float]]


class DatetimeHistogram(TypedDict):
hist: list[int]
bin_edges: list[str] # edges are string representations of dates
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orjson supports datetime serialization though, maybe I should return datetimes then?

transformed_column_name: str,
min_date: datetime.datetime,
) -> pl.DataFrame:
return data.select((pl.col(column_name) - min_date).dt.total_seconds().alias(transformed_column_name))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operate on seconds

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

not sure it works as expected
test fail is not reproduced locally
to debug why test is not passed in CI but works locally
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

Successfully merging this pull request may close these issues.

2 participants