Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_simple_step():
step = cm.StepColormap(['green', 'yellow', 'red'],
vmin=3., vmax=10.,
index=[3, 4, 8, 10], caption='step')
step = cm.StepColormap(['r', 'y', 'g', 'c', 'b', 'm'])
step._repr_html_()
def test_simple_linear():
linear = cm.LinearColormap(['green', 'yellow', 'red'], vmin=3., vmax=10.)
linear = cm.LinearColormap(['red', 'orange', 'yellow', 'green'],
index=[0, 0.1, 0.9, 1.])
linear._repr_html_()
import os
import folium
# print(folium.__version__)
import branca.colormap as cm
import os
import math
# env = %env
# pd.set_option('display.max_rows', 2000)
center2 = [54.840471, -110.269399]
zoom2 = 6
linear2 = cm.LinearColormap(
["#edf8b1", "#7fcdbb", "#2c7fb8", "#273891"], vmin=-100, vmax=75
)
print(linear2)
def depth_color(depth):
if math.isnan(depth):
print(" math.isnan(depth) => ", depth)
return "blue"
else:
depth = float(depth)
if depth >= 50:
color = "#3182bd"
elif depth > 10 and depth < 50:
color = "#9ecae1"
########## imports ########
import os
import folium
#print(folium.__version__)
import branca.colormap as cm
import os
import math
#env = %env
#pd.set_option('display.max_rows', 2000)
center2 = [54.840471, -110.269399]
zoom2 = 6
linear2 = cm.LinearColormap(
['#edf8b1','#7fcdbb','#2c7fb8','#273891'],
vmin=-100, vmax=75
)
print(linear2)
def depth_color(depth):
if(math.isnan(depth)):
print(" math.isnan(depth) => ", depth)
return 'blue'
else:
depth = float(depth)
if depth >= 50:
color = '#3182bd'
elif depth > 10 and depth < 50:
color = '#9ecae1'
import os
import folium
# print(folium.__version__)
import branca.colormap as cm
import os
import math
# env = %env
# pd.set_option('display.max_rows', 2000)
center2 = [54.840471, -110.269399]
zoom2 = 6
linear2 = cm.LinearColormap(
["#edf8b1", "#7fcdbb", "#2c7fb8", "#273891"], vmin=-100, vmax=75
)
def depth_color(depth):
if math.isnan(depth):
print(" math.isnan(depth) => ", depth)
return "blue"
else:
depth = float(depth)
if depth >= 50:
color = "#3182bd"
elif depth > 10 and depth < 50:
color = "#9ecae1"
elif depth > -10 and depth < 10:
color = "green"