-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
fixed bug where pd.NA was being cast to NaN during formatting #55754
Merged
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b648389
fixed bug where pd.NA was being cast to NaN during formatting
dominiquegarmier 1efa677
implementing suggestion by Richard Shadrach
dominiquegarmier 1c4d435
added test
dominiquegarmier 331ea63
typo
dominiquegarmier 560197d
Merge branch 'main' into main
dominiquegarmier b23a481
running pre-commit
dominiquegarmier 518b12c
Merge branch 'main' of github.com:DominiqueGarmier/pandas
dominiquegarmier 6017dcc
this is more efficient
dominiquegarmier 722abaa
implemented using numpy
dominiquegarmier 2520356
Merge branch 'main' into main
dominiquegarmier 03b39d6
Merge branch 'main' into main
dominiquegarmier bf0d1b1
changed test size from 100 to 10
dominiquegarmier e7b7e02
Merge branch 'main' into main
dominiquegarmier 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,15 @@ def test_repr_truncation(self): | |
with option_context("display.max_colwidth", max_len + 2): | ||
assert "..." not in repr(df) | ||
|
||
def test_repr_truncation_preserves_na(self): | ||
# https://github.com/pandas-dev/pandas/issues/55630 | ||
with option_context("display.max_rows", 10): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you set this to 2 instead of 10, I think we could then test for the entire string. |
||
df = DataFrame({"A": [pd.NA for _ in range(100)]}) | ||
|
||
r = repr(df) | ||
for row in r.split("\n")[1:-2]: | ||
assert row.endswith(("<NA>", "...")) | ||
|
||
def test_max_colwidth_negative_int_raises(self): | ||
# Deprecation enforced from: | ||
# https://github.com/pandas-dev/pandas/issues/31532 | ||
|
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.
Thanks - this is definitely a lot better. I think we can do a little better by using NumPy instead.