Redefining built-in 'filter'
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 ]
Description
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
Bad practice
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
Preferred:
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx