def dispatch_to_series(left, right, func, str_rep=None, axis=None):
<EOL>import pandas.core.computation.expressions as expressions<EOL>right = lib.item_from_zerodim(right)<EOL>if lib.is_scalar(right) or np.ndim(right) == <NUM_LIT:0>:<EOL><INDENT>def column_op(a, b):<EOL><INDENT>return {i: func(a.iloc[:, i], b)<EOL>for i in range(len(a.columns))}<EOL><DEDENT><DEDENT>elif isinstance(right, ABCDataFrame):<EOL><INDENT>assert right._indexed_same(left)<EOL>def column_op(a, b):<EOL><INDENT>return {i: func(a.iloc[:, i], b.iloc[:, i])<EOL>for i in range(len(a.columns))}<EOL><DEDENT><DEDENT>elif isinstance(right, ABCSeries) and axis == "<STR_LIT>":<EOL><INDENT>assert right.index.equals(left.columns)<EOL>def column_op(a, b):<EOL><INDENT>return {i: func(a.iloc[:, i], b.iloc[i])<EOL>for i in range(len(a.columns))}<EOL><DEDENT><DEDENT>elif isinstance(right, ABCSeries):<EOL><INDENT>assert right.index.equals(left.index)  <EOL>def column_op(a, b):<EOL><INDENT>return {i: func(a.iloc[:, i], b)<EOL>for i in range(len(a.columns))}<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise NotImplementedError(right)<EOL><DEDENT>new_data = expressions.evaluate(column_op, str_rep, left, right)<EOL>result = left._constructor(new_data, index=left.index, copy=False)<EOL>result.columns = left.columns<EOL>return result<EOL>
Evaluate the frame operation func(left, right) by evaluating
column-by-column, dispatching to the Series implementation.

Parameters
----------
left : DataFrame
right : scalar or DataFrame
func : arithmetic or comparison operator
str_rep : str or None, default None
axis : {None, 0, 1, "index", "columns"}

Returns
-------
DataFrame