Brainiac11 / My-Projects

Re-defined variable from outer scope PYL-W0621
Anti-pattern
Major
a year agoa year old
Redefining name 'y' from outer scope (line 216)
176        def main():
177            # observations / data
178            x = np.array(data_point_list_x)
179            y = np.array(data_point_list_y)180
181            # estimating coefficients
182            b = estimate_coef(x, y)
Redefining name 'x' from outer scope (line 82)
175
176        def main():
177            # observations / data
178            x = np.array(data_point_list_x)179            y = np.array(data_point_list_y)
180
181            # estimating coefficients
Redefining name 'x' from outer scope (line 82)
154            return (b_0, b_1)
155
156
157        def plot_regression_line(x, y, b):158            # plotting the actual points as scatter plot
159            plt.scatter(x, y, color="m",
160                        marker="o", s=30)
Redefining name 'y' from outer scope (line 216)
135        
136        operatorReaction(x)
137        operatorReaction2(x)
138        def estimate_coef(x, y):139            # number of observations/points
140            n = np.size(x)
141
Redefining name 'x' from outer scope (line 82)
135        
136        operatorReaction(x)
137        operatorReaction2(x)
138        def estimate_coef(x, y):139            # number of observations/points
140            n = np.size(x)
141