-
Notifications
You must be signed in to change notification settings - Fork 15
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
bin_df_cols
leave input df unchanged
#192
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d13e58f
count_elements default fill_value=0->None
janosh b6f1954
ptable_heatmap_plotly default fig title pos to (x=0.4, y=0.95)
janosh 0a4711c
fix bin_df_cols modifying input df, now tested to leave input unchanged
janosh 69f317d
pin scipy<1.14 since requires python 3.10
janosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
@janosh This seem to cause the behaviour change in #215, is this an accidental change? I think the original default value of
0
is correct here? i.e. using0
for element this is missing?pymatviz/pymatviz/process_data.py
Line 55 in 82c087b
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.
thanks for looking into this! 🙏 i think returning
None
for missing elements incount_elements
is more correct/semantic than 0. so ideally,ptable_heatmap_ratio
should be updated to work with the new behaviorThere 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 guess both choices hold merit from certain standpoint, i.e.
None
is more semantic to suggest that particular element is missing,0
is also valid as its count is indeed zero.For the particular function, however, I slight prefer using zero because it seems to be designed to "count element occurrence":
pymatviz/pymatviz/process_data.py
Lines 26 to 28 in 82c087b
So its occurrence would be zero if that particular element doesn't appear in the data.
I'm afraid this would have broader impact as there're quite a few usage that need to be checked:
For example:
With fill value zero:
With
None
:Using
None
seem to require an additional process step .So do we want to change this completely or revert this?