Skip to content

Commit 32cd619

Browse files
authored
Remove split_six utility function (#161)
1 parent d5a2cc2 commit 32cd619

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

branca/utilities.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
from jinja2 import Environment, PackageLoader
2020

21-
try:
22-
import pandas as pd
23-
except ImportError:
24-
pd = None
25-
2621
try:
2722
import numpy as np
2823
except ImportError:
@@ -203,39 +198,6 @@ def color_brewer(color_code, n=6):
203198
return color_scheme
204199

205200

206-
def split_six(series=None):
207-
"""
208-
Given a Pandas Series, get a domain of values from zero to the 90% quantile
209-
rounded to the nearest order-of-magnitude integer. For example, 2100 is
210-
rounded to 2000, 2790 to 3000.
211-
212-
Parameters
213-
----------
214-
series: Pandas series, default None
215-
216-
Returns
217-
-------
218-
list
219-
220-
"""
221-
if pd is None:
222-
raise ImportError("The Pandas package is required" " for this functionality")
223-
if np is None:
224-
raise ImportError("The NumPy package is required" " for this functionality")
225-
226-
def base(x):
227-
if x > 0:
228-
base = pow(10, math.floor(math.log10(x)))
229-
return round(x / base) * base
230-
else:
231-
return 0
232-
233-
quants = [0, 50, 75, 85, 90]
234-
# Some weirdness in series quantiles a la 0.13.
235-
arr = series.values
236-
return [base(np.percentile(arr, x)) for x in quants]
237-
238-
239201
def image_to_url(image, colormap=None, origin="upper"):
240202
"""Infers the type of an image argument and transforms it into a URL.
241203

0 commit comments

Comments
 (0)