MCPcopy Create free account
hub / github.com/dask/dask / is_broadcastable

Function is_broadcastable

dask/dataframe/dask_expr/_expr.py:3185–3202  ·  view source on GitHub ↗

This Series is broadcastable against another dataframe in the sequence

(dfs, s)

Source from the content-addressed store, hash-verified

3183
3184
3185def is_broadcastable(dfs, s):
3186 """
3187 This Series is broadcastable against another dataframe in the sequence
3188 """
3189
3190 def compare(s, df):
3191 try:
3192 return s.divisions == (min(df.columns), max(df.columns))
3193 except (TypeError, ValueError):
3194 return False
3195
3196 return (
3197 s.ndim == 1
3198 and s.npartitions == 1
3199 and s.known_divisions
3200 and any(compare(s, df) for df in dfs if df.ndim == 2)
3201 or s.ndim == 0
3202 )
3203
3204
3205def are_co_aligned(*exprs):

Callers 1

argsMethod · 0.85

Calls 2

anyFunction · 0.85
compareFunction · 0.85

Tested by

no test coverage detected