(self)
Get the edges in the histogram based on the attribute type.

        In case of a continuous variable, we split the variable range into
        n bins. In case of a discrete variable, bins don't make sense, so we
        just return the attribute values.

        This will return the staring and ending edge, not just the edges in
        between (in the case of a continuous variable).

        Returns
        -------
        np.ndarray
Get the edges in the histogram based on the attribute type.
Get the edges in the histogram based on the attribute type .
def _get_histogram_edges(self):
        """Get the edges in the histogram based on the attribute type.

        In case of a continuous variable, we split the variable range into
        n bins. In case of a discrete variable, bins don't make sense, so we
        just return the attribute values.

        This will return the staring and ending edge, not just the edges in
        between (in the case of a continuous variable).

        Returns
        -------
        np.ndarray

        """
        if self.attribute.is_discrete:
            return np.array([self.attribute.to_val(v) for v in self.attribute.values])
        else:
            edges = np.linspace(ut.nanmin(self.x), ut.nanmax(self.x), self.n_bins)
            edge_diff = edges[1] - edges[0]
            edges = np.hstack((edges, [edges[-1] + edge_diff]))

            # If the variable takes on a single value, we still need to spit
            # out some reasonable bin edges
            if np.all(edges == edges[0]):
                edges = np.array([edges[0] - 1, edges[0], edges[0] + 1])

            return edges
def _get_histogram_edges ( self ) : if self . attribute . is_discrete : return np . array ( [ self . attribute . to_val ( v ) for v in self . attribute . values ] ) else : edges = np . linspace ( ut . nanmin ( self . x ) , ut . nanmax ( self . x ) , self . n_bins ) edge_diff = edges [ 1 ] - edges [ 0 ] edges = np . hstack ( ( edges , [ edges [ - 1 ] + edge_diff ] ) ) # If the variable takes on a single value, we still need to spit # out some reasonable bin edges if np . all ( edges == edges [ 0 ] ) : edges = np . array ( [ edges [ 0 ] - 1 , edges [ 0 ] , edges [ 0 ] + 1 ] ) return edges