50f590603a1dd562453926edaab69267633b8455,python/hypertools/_shared/helpers.py,,vals2colors,#Any#Any#Any#,25
Before Change
palette = sns.color_palette(cmap, res)
// rank the values and then normalize
ranks = list(map(lambda x: sum([val <= x for val in vals]),vals))
ranks = list(map(lambda rank: int(res*rank/len(vals)),ranks))
return [palette[rank-1] for rank in ranks]
// this will be moved to utils.py
def is_list(x):
After Change
// get palette from seaborn
palette = np.array(sns.color_palette(cmap, res))
ranks = np.digitize(vals, np.linspace(np.min(vals), np.max(vals)+1, res+1)) - 1
return palette[ranks, :]
// this will be moved to utils.py
def is_list(x):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: ContextLab/hypertools
Commit Name: 50f590603a1dd562453926edaab69267633b8455
Time: 2016-12-20
Author: andrew.heusser@gmail.com
File Name: python/hypertools/_shared/helpers.py
Class Name:
Method Name: vals2colors
Project Name: datascienceinc/Skater
Commit Name: 5601c4bb909b4146327fa68c6d5b668f997baaff
Time: 2017-03-21
Author: aikramer2@gmail.com
File Name: pyinterpret/data/dataset.py
Class Name: DataSet
Method Name: _build_metastore
Project Name: ContextLab/hypertools
Commit Name: 3c8f5966e66f2222d2cfa3770d2ac923d254b61a
Time: 2016-12-20
Author: andrew.heusser@gmail.com
File Name: python/hypertools/_shared/helpers.py
Class Name:
Method Name: vals2colors