summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony <42574242+tohabyuraev@users.noreply.github.com>2020-01-26 22:23:53 +0300
committerGitHub <noreply@github.com>2020-01-26 22:23:53 +0300
commitfcaf5b3739831cae342c6acdbc30e1a5124b9982 (patch)
tree89056650bfec64b9a77e7cfca72d1326fadd0158
parent62a2e8ba7b8f8aa12e363a0dcf8cee2282f8711c (diff)
downloadnumpy-fcaf5b3739831cae342c6acdbc30e1a5124b9982.tar.gz
Update core.py with f-strings (issue #15420)
Corrected past shortcomings
-rw-r--r--numpy/ma/core.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index eee57fa2b..0e93b878b 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3269,7 +3269,7 @@ class MaskedArray(ndarray):
dout._fill_value.flat[0]).all():
warnings.warn(
"Upon accessing multidimensional field "
- f"{indx:s}, need to keep dimensionality "
+ f"{indx!s}, need to keep dimensionality "
"of fill_value at 0. Discarding "
"heterogeneous fill_value and setting "
f"all to {dout._fill_value[0]!s}.",
@@ -3914,7 +3914,10 @@ class MaskedArray(ndarray):
dtype=str(self.dtype)
)
is_structured = bool(self.dtype.names)
- key = f"{'long' if is_long else 'short'}_{'flx' if is_structured else 'std'}"
+ key = '{}_{}'.format(
+ 'long' if is_long else 'short',
+ 'flx' if is_structured else 'std'
+ )
return _legacy_print_templates[key] % parameters
prefix = f"masked_{name}("