Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f7fdcd7
Adding the SessionEncoder
rcap107 Feb 24, 2026
65be83a
more work
rcap107 Feb 25, 2026
a6caeb7
adding tests
rcap107 Feb 25, 2026
cc14c55
changelog
rcap107 Feb 25, 2026
dba476f
adding drop cols, various improvements
rcap107 Feb 25, 2026
d46090d
adding a test
rcap107 Feb 25, 2026
28b958a
simplifying tests and code
rcap107 Feb 25, 2026
ac7389d
docstrings
rcap107 Feb 25, 2026
8a61ea0
adding support for multiple by columns
rcap107 Feb 26, 2026
a70006f
fixing optional by
rcap107 Feb 26, 2026
429f155
ddocs
rcap107 Feb 26, 2026
23c4111
fixing a compatibility problem
rcap107 Feb 26, 2026
acb091f
changelog
rcap107 Feb 26, 2026
d69fb9e
improving tests
rcap107 Feb 26, 2026
e0199f5
renaming session id column
rcap107 Feb 26, 2026
603a57b
fixing some broken tests
rcap107 Feb 26, 2026
9d2c577
doctest
rcap107 Feb 26, 2026
8d869b2
testing error dispatch
rcap107 Feb 26, 2026
01fed5f
addressing some of the coments
rcap107 Feb 27, 2026
746109b
addressing more comments
rcap107 Feb 27, 2026
71302b1
fixing test
rcap107 Feb 27, 2026
ea99353
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Feb 27, 2026
bca2db2
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Mar 27, 2026
868d529
changelo
rcap107 Mar 27, 2026
e27b23c
Merge remote-tracking branch 'upstream/main' into feat-session-encoder
rcap107 Apr 9, 2026
25ce541
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Apr 10, 2026
280d6f1
Merge remote-tracking branch 'upstream/main' into feat-session-encoder
rcap107 Apr 13, 2026
b37bec7
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Apr 22, 2026
bd64559
reordering rows after adding session id
rcap107 Apr 22, 2026
3758a43
Merge remote-tracking branch 'upstream/main' into feat-session-encoder
rcap107 Apr 28, 2026
c8e91c9
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 May 22, 2026
8ddd651
fixing changelog after merge
rcap107 May 22, 2026
dcc1369
implementing a fix from review
rcap107 May 24, 2026
87371e6
reordering columns so that the session id is added as last col
rcap107 May 26, 2026
b336d9b
more fixes
rcap107 May 26, 2026
9fbe79d
_
rcap107 May 26, 2026
1680162
example
rcap107 May 27, 2026
091a66c
docstrings
rcap107 May 28, 2026
8248f50
changing to seconds
rcap107 May 28, 2026
6c2a92c
more tests
rcap107 May 28, 2026
542042b
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 May 28, 2026
8c6d6a3
ensuring that columns do not get overwritten
rcap107 May 28, 2026
b834395
renaming a parameter
rcap107 May 28, 2026
091c122
_
rcap107 May 28, 2026
6de367c
fixing a bug on windows
rcap107 May 28, 2026
08d2b11
Merge remote-tracking branch 'upstream/main' into feat-session-encoder
rcap107 May 29, 2026
528006b
adding new generator and example
rcap107 May 29, 2026
d26222f
adding comments
rcap107 May 29, 2026
26e4436
fixing inconsistency
rcap107 May 29, 2026
fecc532
fixing possible bug
rcap107 May 29, 2026
bf58d53
comments
rcap107 May 29, 2026
2aa11cc
grr
rcap107 May 29, 2026
3c79333
Apply suggestions from code review
rcap107 Jun 1, 2026
8b30ebd
Update skrub/_session_encoder.py
rcap107 Jun 1, 2026
e561d9b
improvements and changes from review
rcap107 Jun 1, 2026
d9012dc
more improvements
rcap107 Jun 1, 2026
d73c45b
adding plain example
rcap107 Jun 1, 2026
b77a59e
rewording
rcap107 Jun 1, 2026
8ee2bee
cleanup docstring
rcap107 Jun 1, 2026
981134e
Update examples/data_ops/1170_session_encoder.py
rcap107 Jun 2, 2026
d5aeecd
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Jun 2, 2026
f62a605
Merge branch 'feat-session-encoder' of github.com:rcap107/skrub into …
rcap107 Jun 2, 2026
6b03b14
fixing timezone
rcap107 Jun 2, 2026
89c79b7
doc cleanup
rcap107 Jun 2, 2026
1f5fe6f
more on docs
rcap107 Jun 2, 2026
ecf5e0f
_
rcap107 Jun 2, 2026
f694e15
_
rcap107 Jun 2, 2026
36e6585
Merge remote-tracking branch 'upstream/main' into feat-session-encoder
rcap107 Jun 3, 2026
fdab72a
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Jun 8, 2026
e033cdf
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Jun 8, 2026
2de71c4
addressing some of the comments from the review
rcap107 Jun 8, 2026
1dc32c2
clean up test
rcap107 Jun 8, 2026
d199ec2
addressing more comments
rcap107 Jun 8, 2026
aada173
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Jun 9, 2026
d22774c
changelog
rcap107 Jun 9, 2026
f728604
example
rcap107 Jun 9, 2026
f215bdb
slight rewording
rcap107 Jun 9, 2026
679077a
Merge remote-tracking branch 'upstream/HEAD' into feat-session-encoder
rcap107 Jun 15, 2026
5f04c14
Apply suggestions from code review
rcap107 Jun 15, 2026
efada37
fixing doctest
rcap107 Jun 15, 2026
73adcfb
reworking docstring, renaming attr
rcap107 Jun 15, 2026
74f5991
moving error checking, more work on docstring
rcap107 Jun 15, 2026
49a4583
simplifying part of the code
rcap107 Jun 15, 2026
77942d2
addressing comments
rcap107 Jun 15, 2026
05c7bf7
removing factorizer
rcap107 Jun 15, 2026
b389575
docstring
rcap107 Jun 15, 2026
9675950
doc fixes
rcap107 Jun 15, 2026
0787468
pandas grrr
rcap107 Jun 15, 2026
2951486
fixing test on min deps
rcap107 Jun 16, 2026
326dbb9
adding a comment
rcap107 Jun 16, 2026
e04fd29
changelog
rcap107 Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ New Features
faster (the overhead it removes typically becomes noticeable only in DataOps
with 50-100 nodes or more). Moreover, the evaluation of large DataOps has also
become faster. :pr:`1890` by :user:`Jérôme Dockès <jeromedockes>`.
- The :class:`SessionEncoder` is now available. This encoder takes a dataframe with
a timestamp column and computes sessions based on the given session duration.
Additionally, it is possible to provide a ``by`` column or list of columns
(e.g., user ID or (user ID, user device)) to compute sessions for each grouping
value.
:pr:`1930` by :user:`Riccardo Cappuzzo <rcap107>`.

Changes
-------
Expand Down
1 change: 1 addition & 0 deletions doc/api_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"SimilarityEncoder",
"ToCategorical",
"DatetimeEncoder",
"SessionEncoder",
"ToDatetime",
"ToFloat",
],
Expand Down
2 changes: 2 additions & 0 deletions skrub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from ._multi_agg_joiner import MultiAggJoiner
from ._reporting import TableReport, patch_display, unpatch_display
from ._select_cols import Drop, DropCols, SelectCols
from ._session_encoder import SessionEncoder
from ._similarity_encoder import SimilarityEncoder
from ._squashing_scaler import SquashingScaler
from ._string_encoder import StringEncoder
Expand Down Expand Up @@ -107,4 +108,5 @@
"ApplyToSubFrame",
"ApplyToCols",
"ToFloat",
"SessionEncoder",
]
16 changes: 16 additions & 0 deletions skrub/_dataframe/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"reset_index",
"copy_index",
"index",
"drop_columns",
#
# Inspecting dtypes and casting
#
Expand Down Expand Up @@ -632,6 +633,21 @@ def _index_pandas(obj):
return obj.index


@dispatch
def drop_columns(df, columns):
raise_dispatch_unregistered_type(df, kind="DataFrame")


@drop_columns.specialize("pandas", argument_type="DataFrame")
def _drop_columns_pandas(df, columns):
return df.drop(columns=columns)


@drop_columns.specialize("polars", argument_type="DataFrame")
def _drop_columns_polars(df, columns):
return df.drop(columns)


#
# Inspecting dtypes and casting
# =============================
Expand Down
9 changes: 9 additions & 0 deletions skrub/_dataframe/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,15 @@ def test_index(df_module):
assert ns.index(col) is None


def test_drop_columns(df_module):
df = df_module.example_dataframe
col_names = ns.column_names(df)
col_to_drop = col_names[0]
df_dropped = ns.drop_columns(df, [col_to_drop])
assert col_to_drop not in ns.column_names(df_dropped)
assert len(ns.column_names(df_dropped)) == len(col_names) - 1


#
# Inspecting dtypes and casting
# =============================
Expand Down
Loading
Loading