pivoted_table = pd.pivot_table(master_table, index=['country', 'iso3c'], columns='year', values='GINI_INDEX')
pivoted_table = pivoted_table.ffill(axis=1)
countries = list(pivoted_table.index.get_level_values(0))
locations = list(pivoted_table.index.get_level_values(1))
for year in pivoted_table.columns:
colorscale=px.colors.sequential.Reds,
args=['visible', [False] * len(pivoted_table.columns)],
step['args'][1][i] = True
text='Evolution of the gini index from 1969 to 2018',
sliders=[dict(steps=steps, active=len(data) - 1)],
text='Updated in 2018 from The World Bank',
fig = go.Figure(data, layout)