pnijhara / sih-2019

Re-defined variable from outer scope PYL-W0621
Anti-pattern
Major
11 occurrences in this check
Redefining name 'data' from outer scope (line 11)
20
21
22def generate_table(_dataframe, _max_rows=10):
23    data = pd.read_excel(24        "data/2018/aggregates-economic-activity/S7.1.xlsx", header=None
25    )
26    df = data[3:]
Redefining name 'rows' from outer scope (line 18)
 79layout = app_layout()
 80
 81
 82def filter(year, _category, rows, labels, remove=False): 83    cu_index, co_index = [
 84        index for index in years.transpose().index if years[index].iloc[0] == year
 85    ]
Redefining name 'labels' from outer scope (line 19)
 79layout = app_layout()
 80
 81
 82def filter(year, _category, rows, labels, remove=False): 83    cu_index, co_index = [
 84        index for index in years.transpose().index if years[index].iloc[0] == year
 85    ]
Redefining name 'labels' from outer scope (line 22)
 83layout = app_layout()
 84
 85
 86def filter(year, _category, rows, labels, remove=False): 87    cu_index, co_index = [
 88        index for index in years.transpose().index if years[index].iloc[0] == year
 89    ]
Redefining name 'rows' from outer scope (line 21)
 83layout = app_layout()
 84
 85
 86def filter(year, _category, rows, labels, remove=False): 87    cu_index, co_index = [
 88        index for index in years.transpose().index if years[index].iloc[0] == year
 89    ]
Redefining name 'rows' from outer scope (line 24)
 86layout = app_layout()
 87
 88
 89def filter(year, _category, rows, labels, remove=False): 90    cu_index, co_index = [
 91        index for index in years.transpose().index if years[index].iloc[0] == year
 92    ]
Redefining name 'labels' from outer scope (line 25)
 86layout = app_layout()
 87
 88
 89def filter(year, _category, rows, labels, remove=False): 90    cu_index, co_index = [
 91        index for index in years.transpose().index if years[index].iloc[0] == year
 92    ]
Redefining name 'rows' from outer scope (line 17)
 79layout = app_layout()
 80
 81
 82def filter(year, _category, rows, labels, remove=False): 83    cu_index, co_index = [
 84        index for index in years.transpose().index if years[index].iloc[0] == year
 85    ]
Redefining name 'labels' from outer scope (line 18)
 79layout = app_layout()
 80
 81
 82def filter(year, _category, rows, labels, remove=False): 83    cu_index, co_index = [
 84        index for index in years.transpose().index if years[index].iloc[0] == year
 85    ]
Redefining name 'data' from outer scope (line 18)
 61
 62
 63def generate_table(_dataframe, _max_rows=10):
 64    data = pd.read_excel(filename, header=None) 65    df = data[6:-1]
 66    df.columns = df.iloc[0].fillna(value=pd.Series(range(100)))
 67    return dash_table.DataTable(
Redefining name 'data' from outer scope (line 19)
 65
 66
 67def generate_table(_dataframe, _max_rows=10):
 68    data = pd.read_excel( 69        "data/2018/aggregates-economic-activity/S7.1.xlsx", header=None
 70    )
 71    df = data[3:]