Registry Mirror
Skip to content

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown
Contributor

Summary

Fixes #11373

The docstring for DataArray.pad incorrectly stated that constant_values defaults to 0. The actual parameter default is None, which results in NaN padding (not zero). This can be verified in Variable.pad where constant_values is None triggers dtypes.maybe_promote() to fill with NaN.

Changes

Updated the constant_values parameter documentation in DataArray.pad:

  • default: 0 → default: None
  • Default is 0. → Default is ``None``, pads with ``np.nan``.

This now matches the Dataset.pad docstring which already correctly documents this behavior.

The docstring for DataArray.pad incorrectly stated that constant_values
defaults to 0. The actual default is None, which results in NaN padding
(see Variable.pad implementation). Updated to match the Dataset.pad
docstring which already correctly documents this behavior.

Fixes pydata#11373
@headtr1ck

Copy link
Copy Markdown
Collaborator

duplicate of #11375

@headtr1ck headtr1ck closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation error for DataArray.pad

2 participants