Skip to content

DOC: Clarify numpy.asarray order='A' parameter behavior #29581

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

Closed
wants to merge 2 commits into from

Conversation

ickma2311
Copy link

Fixes #28247 by updating the documentation for the order='A' parameter in numpy.asarray() and numpy.asanyarray().

The previous documentation incorrectly stated that order='A' means 'F' if input is Fortran contiguous, 'C' otherwise.

The actual behavior is:

  • When no copy is needed: preserves the input array's layout exactly
  • When a copy is made: uses 'F' if input is Fortran contiguous, 'C' otherwise

Added a clear example demonstrating that order='A' preserves existing array layout when possible.

Fixes numpy#28247 by updating the documentation for the order='A'
parameter in numpy.asarray() and numpy.asanyarray().

The previous documentation incorrectly stated that order='A'
means 'F' if input is Fortran contiguous, 'C' otherwise.

The actual behavior is:
- When no copy is needed: preserves the input array's layout exactly
- When a copy is made: uses 'F' if input is Fortran contiguous, 'C' otherwise

Added a clear example demonstrating that order='A' preserves
existing array layout when possible.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removes trailing whitespace that was causing linting failures in CI/CD pipeline.
@ickma2311 ickma2311 closed this Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: order="A" doesn't do anything?
1 participant