Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: 'style' arg to array2string broken in legacy mode (1.14 Backport)#10947

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
BUG: 'style' arg to array2string broken in legacy mode
Fixes#10934
  • Loading branch information
@ahaldane
ahaldane committedApr 21, 2018
commita280b7c47586bebf4e1baff6ec604c4713ef1097
3 changes: 3 additions & 0 deletionsnumpy/core/arrayprint.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -612,6 +612,9 @@ def array2string(a, max_line_width=None, precision=None,
options.update(overrides)

if options['legacy'] == '1.13':
if style is np._NoValue:
style = repr

if a.shape == () and not a.dtype.names:
return style(a.item())
elif style is not np._NoValue:
Expand Down
2 changes: 2 additions & 0 deletionsnumpy/core/tests/test_arrayprint.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -488,6 +488,8 @@ def test_0d_arrays(self):
np.array(1.), style=repr)
# but not in legacy mode
np.array2string(np.array(1.), style=repr, legacy='1.13')
# gh-10934 style was broken in legacy mode, check it works
np.array2string(np.array(1.), legacy='1.13')

def test_float_spacing(self):
x = np.array([1., 2., 3.])
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp