We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 943da8d commit 72b3b9aCopy full SHA for 72b3b9a
src/zarr/core/buffer/cpu.py
@@ -154,9 +154,10 @@ def create(
154
order: Literal["C", "F"] = "C",
155
fill_value: Any | None = None,
156
) -> Self:
157
- return cls(
158
- np.full(shape=tuple(shape), fill_value=fill_value or 0, dtype=dtype, order=order)
159
- )
+ if fill_value is None:
+ return cls(np.zeros(shape=tuple(shape), dtype=dtype, order=order))
+ else:
160
+ return cls(np.full(shape=tuple(shape), fill_value=fill_value, dtype=dtype, order=order))
161
162
@classmethod
163
def from_numpy_array(cls, array_like: npt.ArrayLike) -> Self:
0 commit comments