Remove the use of Pandas' iloc() in WorldMapViz (#7379)

When the same metric is used in a World Map panel for both bubble size
and an axis (either X or Y), it currently breaks the rendering.

The change in behavior was introduced in:
71e0c07904 (diff-f451672348fc6071e8d627778bdc4e96L1730)

The use of .iloc() is not needed anymore since the code that used
to duplicate the metric is not there anymore.

Should fix #7006
This commit is contained in:
Luca Toscano 2019-05-28 23:19:04 +02:00 committed by Maxime Beauchemin
parent f7d3413a50
commit b21f8ec804
1 changed files with 1 additions and 3 deletions

View File

@ -1765,9 +1765,7 @@ class WorldMapViz(BaseViz):
columns = ['country', 'm1', 'm2']
if metric == secondary_metric:
ndf = df[cols]
# df[metric] will be a DataFrame
# because there are duplicate column names
ndf['m1'] = df[metric].iloc[:, 0]
ndf['m1'] = df[metric]
ndf['m2'] = ndf['m1']
else:
if secondary_metric: