Skip to content

fix: 'Table.summarize_statistics()' fixed#777

Closed
SamanHushi wants to merge 3 commits intoSafe-DS:mainfrom
SamanHushi:summarize_statistigs_bool_bug
Closed

fix: 'Table.summarize_statistics()' fixed#777
SamanHushi wants to merge 3 commits intoSafe-DS:mainfrom
SamanHushi:summarize_statistigs_bool_bug

Conversation

@SamanHushi
Copy link
Member

Summary of Changes

cast the pl.series to str when its filled with bools when calculating variance.
This is needed because it can't get unique_counts from bools

@codecov
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.21%. Comparing base (8b8fb5d) to head (ae0eb4c).
Report is 81 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #777   +/-   ##
=======================================
  Coverage   97.20%   97.21%           
=======================================
  Files         107      107           
  Lines        5519     5522    +3     
=======================================
+ Hits         5365     5368    +3     
  Misses        154      154           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SamanHushi SamanHushi changed the title Summarize statistigs bool bug fix: 'Table.summarize_statistics()' fixed May 17, 2024

if type(non_missing.dtype)==pl.datatypes.Boolean:
non_missing = non_missing.cast(str)
mode_count = non_missing.unique_counts().max()
Copy link
Member

@lars-reimann lars-reimann May 17, 2024

Choose a reason for hiding this comment

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

non_missing.value_counts().get_column("count").max()

Seems to work for boolean as well, which saves us the conversion.

@lars-reimann
Copy link
Member

Thanks I've included this in #778 and specified you as a co-author.

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