Skip to content

Fix incorrect default value for constant_values in DataArray.pad docs#11420

Open
C1-BA-B1-F3 wants to merge 1 commit into
pydata:mainfrom
C1-BA-B1-F3:fix-doc-pad-constant-values
Open

Fix incorrect default value for constant_values in DataArray.pad docs#11420
C1-BA-B1-F3 wants to merge 1 commit into
pydata:mainfrom
C1-BA-B1-F3:fix-doc-pad-constant-values

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown

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: 0default: 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
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

1 participant