MCPcopy Create free account
hub / github.com/pydata/xarray / concatenate

Function concatenate

xarray/core/duck_array_ops.py:445–453  ·  view source on GitHub ↗

concatenate() with better dtype promotion rules.

(arrays, axis=0)

Source from the content-addressed store, hash-verified

443
444
445def concatenate(arrays, axis=0):
446 """concatenate() with better dtype promotion rules."""
447 # TODO: `concat` is the xp compliant name, but fallback to concatenate for
448 # older numpy and for cupy
449 xp = get_array_namespace(*arrays)
450 if hasattr(xp, "concat"):
451 return xp.concat(as_shared_dtype(arrays, xp=xp), axis=axis)
452 else:
453 return xp.concatenate(as_shared_dtype(arrays, xp=xp), axis=axis)
454
455
456def stack(arrays, axis=0):

Calls 3

get_array_namespaceFunction · 0.90
as_shared_dtypeFunction · 0.85
concatMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…