-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[ENH] Edit Domain: Merge categorical values #3725
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3725 +/- ##
==========================================
+ Coverage 84.53% 84.81% +0.27%
==========================================
Files 373 374 +1
Lines 68471 68749 +278
==========================================
+ Hits 57884 58307 +423
+ Misses 10587 10442 -145 |
... to count values within renamed values only and not added/dropped.
Orange/widgets/data/oweditdomain.py
Outdated
|
||
import numpy as np | ||
|
||
import Orange.data | ||
|
||
from Orange.preprocess.transformation import Identity, Lookup | ||
from Orange.widgets import widget, gui, settings | ||
from Orange.widgets.data.owconcatenate import unique |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd avoid importing functions from widget modules if possible because it messes up dependencies and complicates future refactorings. I think we'd better treat all functions in widget modules as private (even if not named as such), just as we treat widget classes as final.
Do we have a better place for functions like unique
?
Perhaps better, isn't unique(s)
same as iter(dict.fromkeys(s))
(formally from Python 3.7, de facto already in 3.6). In below code, it's used as list(unique(s))
, which is, I suppose, the same as list(dict.fromkeys(s))
.
Issue
Implements gh-3371
Also fixes and assertion error when two values are renamed to the same value.
Description of changes
Implement merging of categorical values.
Merging can be achieved by simply renaming individual values to the same name, or by selecting multiple values and pressing the merge button (shortcut ctrl + =) and entering/selecting a name in an editable combo box.
Includes