ranaroussi / quantstats

if statements can be merged PTC-W0048
Anti-pattern
Major
3 years ago3 years old
Consider merging collapsible if statements
281        raise ValueError("`returns` must be a pandas Series, "
282                         "but a multi-column DataFrame was passed")
283
284    if benchmark is not None:285        if isinstance(returns, _pd.DataFrame) and len(returns.columns) > 1:
286            raise ValueError("`benchmark` must be a pandas Series, "
287                             "but a multi-column DataFrame was passed")