def color(self, values, ids=(), key_on='<STR_LIT>', palette='<STR_LIT>', **kwargs):
<EOL>id_name, value_name = '<STR_LIT>', '<STR_LIT>'<EOL>if isinstance(values, collections.abc.Mapping):<EOL><INDENT>assert not ids, '<STR_LIT>'<EOL>if hasattr(values, '<STR_LIT>') and len(values.columns) == <NUM_LIT:2>:<EOL><INDENT>table = values<EOL>ids, values = table.columns<EOL>id_name, value_name = table.labels<EOL><DEDENT>else:<EOL><INDENT>dictionary = values<EOL>ids, values = list(dictionary.keys()), list(dictionary.values())<EOL><DEDENT><DEDENT>if len(ids) != len(values):<EOL><INDENT>assert len(ids) == <NUM_LIT:0><EOL>ids = list(range(len(values)))<EOL><DEDENT>m = self._create_map()<EOL>data = pandas.DataFrame({id_name: ids, value_name: values})<EOL>attrs = {<EOL>'<STR_LIT>': json.dumps(self.geojson()),<EOL>'<STR_LIT:data>': data,<EOL>'<STR_LIT>': [id_name, value_name],<EOL>'<STR_LIT>': key_on,<EOL>'<STR_LIT>': palette,<EOL>}<EOL>kwargs.update(attrs)<EOL>m.geo_json(**kwargs)<EOL>colored = self.format()<EOL>colored._folium_map = m<EOL>return colored<EOL>
Color map features by binning values.

        values -- a sequence of values or a table of keys and values
        ids -- an ID for each value; if none are provided, indices are used
        key_on -- attribute of each feature to match to ids
        palette -- one of the following color brewer palettes:

            'BuGn', 'BuPu', 'GnBu', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'RdPu',
            'YlGn', 'YlGnBu', 'YlOrBr', and 'YlOrRd'.

        Defaults from Folium:

        threshold_scale: list, default None
            Data range for D3 threshold scale. Defaults to the following range
            of quantiles: [0, 0.5, 0.75, 0.85, 0.9], rounded to the nearest
            order-of-magnitude integer. Ex: 270 rounds to 200, 5600 to 6000.
        fill_opacity: float, default 0.6
            Area fill opacity, range 0-1.
        line_color: string, default 'black'
            GeoJSON geopath line color.
        line_weight: int, default 1
            GeoJSON geopath line weight.
        line_opacity: float, default 1
            GeoJSON geopath line opacity, range 0-1.
        legend_name: string, default None
            Title for data legend. If not passed, defaults to columns[1].