Skip to content

Commit 738065e

Browse files
authored
Changed integer based indexing to ___location based index
Now selects first element in series rather than 0th element - old way could cause problems when the dataframe being drawn doesn't start at index 0 and starts at a higher number. Happened to me :P
1 parent bae9fa3 commit 738065e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plotly/figure_factory/_facet_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
783783
)
784784
show_legend = False
785785
if color_name:
786-
if isinstance(df[color_name][0], str) or color_is_cat:
786+
if isinstance(df[color_name].iloc[0], str) or color_is_cat:
787787
show_legend = True
788788
if isinstance(colormap, dict):
789789
utils.validate_colors_dict(colormap, 'rgb')

0 commit comments

Comments
 (0)