Example #1
0
    def __init__(self, categorical_data, categories=None, jitter=None, units=None):
        """
        :param categorical_data: The underlying :class:`numpy.ndarray`
        :param categories: List of unique values in the data
        :jitter: Strategy for jittering the data
        """

        # TOOD: deal with custom categories

        super(CategoricalComponent, self).__init__(None, units)

        self._data = categorical_ndarray(categorical_data, copy=False, categories=categories)

        if self._data.ndim != 1:
            raise ValueError("Categorical Data must be 1-dimensional")

        self.jitter(method=jitter)
Example #2
0
    def __init__(self,
                 categorical_data,
                 categories=None,
                 jitter=None,
                 units=None):
        # TOOD: deal with custom categories

        super(CategoricalComponent, self).__init__(None, units)

        self._data = categorical_ndarray(categorical_data,
                                         copy=False,
                                         categories=categories)

        if self._data.ndim < 1:
            raise ValueError("Categorical Data must be at least 1-dimensional")

        self.jitter(method=jitter)
Example #3
0
    def __init__(self, categorical_data, categories=None, jitter=None, units=None):
        """
        :param categorical_data: The underlying :class:`numpy.ndarray`
        :param categories: List of unique values in the data
        :jitter: Strategy for jittering the data
        """

        # TOOD: deal with custom categories

        super(CategoricalComponent, self).__init__(None, units)

        self._data = categorical_ndarray(categorical_data, copy=False, categories=categories)

        if self._data.ndim != 1:
            raise ValueError("Categorical Data must be 1-dimensional")

        self.jitter(method=jitter)