diff --git a/pyoptsparse/pyOpt_optimization.py b/pyoptsparse/pyOpt_optimization.py index 6abecd03..68f2ecd4 100644 --- a/pyoptsparse/pyOpt_optimization.py +++ b/pyoptsparse/pyOpt_optimization.py @@ -697,10 +697,7 @@ def printSparsity(self, verticalPrint=False): var_str = "(" + str(self.dvOffset[dvGroup][1] - self.dvOffset[dvGroup][0]) + ")" half_length = len(var_str) / 2 k = int(varCenters[j]) - txt[ - i, - int(k - half_length + 1) : int(k - half_length + 1 + len(var_str)), - ] = list(var_str) + txt[i, int(k - half_length + 1) : int(k - half_length + 1 + len(var_str))] = list(var_str) for i in range(len(txt)): print("".join(txt[i]))