Repository navigation
Add opt-in normalized value counts - #2169
Draft
Kanish2002 wants to merge 2 commits into
Draft
Kanish2002 wants to merge 2 commits into
Kanish2002 wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reports often need proportions rather than absolute counts. This adds required
normalizeoverloads to the existing DataColumn and DataFrame selector/string operation families.For
["a", "a", null, "b"],valueCounts(normalize = true)excludes the missing observation and returns counts[2/3, 1/3]as nonnullable Double. WithdropNA = false, the denominator includes it and the result is[0.5, 0.25, 0.25].Behavior and compatibility:
count.normalize;falseretains Int counts.DataFrame<*>for the new overloads because the existingValueCount.count: Intschema cannot describe conditional Double output.dataframe-compiler-plugin-core/AGENTS.md, new overloads omit both refinement and interpreter annotations until supported Kotlin plugin versions understand the parameter. Name-based access works; generated result accessors are not implemented.updateGroupscomposition supports normalization per group.Related to #2165. Depends on #2168 for empty observed-column preservation. The branch contains that prerequisite commit followed by the normalization commit; it will need rebasing after the fix lands.
Validation:
annotations/Plugin.ktwith Kotlin 2.4.21 against published dataframe-core 1.0.0-rc01, using friend paths. Production targets JVM 8; tests target JVM 11. This is not a full current-repository build.git diff --check, and all three website sample references pass.Draft for API-design review under the pre-1.0 freeze. Full debug build, repository tests, generated API dump/check, KoDEx and Korro rendering remain pending. The sample references are registered, but rendered snippet generation is not validated.
AI-assisted.