ranaroussi / quantstats

Unary operand used on an unsupported object PYL-E1130
Bug risk
Critical
5 occurrences in this check
bad operand type for unary ~: NoneType
383    index = _pd.concat([index, rbdf["break"]], axis=1)
384
385    # mark first day day
386    index["first_day"] = _pd.isna(index["break"]) & ~_pd.isna(index["break"].shift(1))387    index.loc[index.index[0], "first_day"] = True
388
389    # multiply first day of each rebalance period by the weight
bad operand type for unary ~: NoneType
383    index = _pd.concat([index, rbdf["break"]], axis=1)
384
385    # mark first day day
386    index["first_day"] = _pd.isna(index["break"]) & ~_pd.isna(index["break"].shift(1))387    index.loc[index.index[0], "first_day"] = True
388
389    # multiply first day of each rebalance period by the weight
bad operand type for unary ~: NoneType
383    index = _pd.concat([index, rbdf["break"]], axis=1)
384
385    # mark first day day
386    index["first_day"] = _pd.isna(index["break"]) & ~_pd.isna(index["break"].shift(1))387    index.loc[index.index[0], "first_day"] = True
388
389    # multiply first day of each rebalance period by the weight
bad operand type for unary ~: NoneType
383    index = _pd.concat([index, rbdf["break"]], axis=1)
384
385    # mark first day day
386    index["first_day"] = _pd.isna(index["break"]) & ~_pd.isna(index["break"].shift(1))387    index.loc[index.index[0], "first_day"] = True
388
389    # multiply first day of each rebalance period by the weight
bad operand type for unary ~: NoneType
383    index = _pd.concat([index, rbdf["break"]], axis=1)
384
385    # mark first day day
386    index["first_day"] = _pd.isna(index["break"]) & ~_pd.isna(index["break"].shift(1))387    index.loc[index.index[0], "first_day"] = True
388
389    # multiply first day of each rebalance period by the weight