-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Update NA repr #30821
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
Update NA repr #30821
Changes from all commits
12aa3d3
197efa9
2b0ad63
a148e45
40e8e9e
e92ad57
24995d8
3c1e367
c51c5d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,10 +354,7 @@ class NAType(C_NAType): | |
return NAType._instance | ||
|
||
def __repr__(self) -> str: | ||
return "NA" | ||
|
||
def __str__(self) -> str: | ||
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. Python will automatically use |
||
return "NA" | ||
return "<NA>" | ||
|
||
def __bool__(self): | ||
raise TypeError("boolean value of NA is ambiguous") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1369,6 +1369,7 @@ STR_NA_VALUES = { | |
"N/A", | ||
"n/a", | ||
"NA", | ||
"<NA>", | ||
"#NA", | ||
"NULL", | ||
"null", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1230,7 +1230,7 @@ def _format(x): | |
if x is None: | ||
return "None" | ||
elif x is NA: | ||
return "NA" | ||
return formatter(x) | ||
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. This means that the 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. Will do a PR for this, I think this breaks geopandas |
||
elif x is NaT or np.isnat(x): | ||
return "NaT" | ||
except (TypeError, ValueError): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,7 @@ def test_default_na_values(all_parsers): | |
"N/A", | ||
"n/a", | ||
"NA", | ||
"<NA>", | ||
"#NA", | ||
"NULL", | ||
"null", | ||
|
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.
may want to also mention in the NA section