Skip to content

Commit

Permalink
Fixed range handling of OSU dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 18, 2018
1 parent d8a4da3 commit bf5ea1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 3 additions & 1 deletion holoviews/core/data/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,16 @@ def indexed(cls, dataset, selection):
@classmethod
def range(cls, dataset, dimension):
column = dataset.dimension_values(dimension)
print(column)
if column.dtype.kind == 'M':
return column.min(), column.max()
elif len(column) == 0:
return np.NaN, np.NaN
else:
try:
assert column.dtype.kind not in 'SUO'
return (np.nanmin(column), np.nanmax(column))
except TypeError:
except (AssertionError, TypeError):
column = [v for v in util.python2sort(column) if v is not None]
if not len(column):
return np.NaN, np.NaN
Expand Down
10 changes: 0 additions & 10 deletions holoviews/core/data/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,6 @@ def dframe(cls, columns, dimensions):
return columns.data.copy()


@classmethod
def array(cls, dataset, dimensions):
if not dimensions:
dimensions = dataset.dimensions(label='name')
else:
dimensions = [dataset.get_dimensions(d).name for d in dimensions]
inds = [dataset.data.columns.index(dim.name) for dim in dimensions]
return dataset.data.values[:, inds]


@classmethod
def iloc(cls, dataset, index):
rows, cols = index
Expand Down

0 comments on commit bf5ea1b

Please sign in to comment.