This Series is broadcastable against another dataframe in the sequence
(dfs, s)
| 3183 | |
| 3184 | |
| 3185 | def 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 | |
| 3205 | def are_co_aligned(*exprs): |