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

better handling of timedelta in tablereport #1152

Merged
merged 7 commits into from
Nov 25, 2024

Conversation

jeromedockes
Copy link
Member

@jeromedockes jeromedockes commented Nov 21, 2024

fixes #1132

this converts the duration/timedelta columns to numeric so we get a histogram & summary statistics rather than a bar plot

durations and datetimes are also converted to numeric for the column associations detection

the choice of time unit & conversion could probably be improved but this is already better than treating them as categorical

screenshot_2024-11-21T17:16:03+01:00

@jeromedockes jeromedockes added this to the 0.3.2 milestone Nov 21, 2024
@jeromedockes jeromedockes marked this pull request as ready for review November 22, 2024 13:00
Copy link
Member

@Vincent-Maladiere Vincent-Maladiere left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -112,3 +112,22 @@ def default(self, value):
if isinstance(value, np.floating):
return float(value)
raise


def duration_to_numeric(col):
Copy link
Member

Choose a reason for hiding this comment

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

I like this simple but robust heuristic

@jeromedockes jeromedockes merged commit 2fbd143 into skrub-data:main Nov 25, 2024
25 checks passed
@jeromedockes
Copy link
Member Author

thanks @Vincent-Maladiere

@jeromedockes jeromedockes deleted the fix-1132 branch November 25, 2024 09:14
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.

TimeDelta64DType treated as category by the TableReport
2 participants