8000 BUG: Fix misuse of .names and .fields in various places (backport 14290 to 1.17) by eric-wieser · Pull Request #14339 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fix misuse of .names and .fields in various places (backport 14290 to 1.17) #14339

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

Merged
merged 13 commits into from
Aug 23, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
MAINT: Remove incorrect comment about flattening
Also adjust the code to more clearly indicate what actually happens.
The behavior is identical before and after this patch.
  • Loading branch information
eric-wieser committed Aug 20, 2019
commit 18eb65228d0e3eca03796e9c30744974e53e2997
4 changes: 2 additions & 2 deletions numpy/lib/recfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ def zip_dtype(seqarrays, flatten=False):
else:
for a in seqarrays:
current = a.dtype
if current.names and len(current.names) <= 1:
# special case - dtypes of 0 or 1 field are flattened
if current.names is not None and len(current.names) == 1:
# special case - dtypes of 1 field are flattened
newdtype.extend(get_fieldspec(current))
else:
newdtype.append(('', current))
Expand Down
0