def partial_normalize(self, axis: AxisIdentifier = 0, inplace: bool = False):
        """Normalize in rows or columns.

        Parameters
        ----------
        axis: int or str
            Along which axis to sum (numpy-sense)
        inplace: bool
            Update the object itself

        Returns
        -------
        hist : Histogram2D
        """
        # TODO: Is this applicable for HistogramND?
        axis = self._get_axis(axis)
        if not inplace:
            copy = self.copy()
            copy.partial_normalize(axis, inplace=True)
            return copy
        else:
            self._coerce_dtype(float)
            if axis == 0:
                divisor = self._frequencies.sum(axis=0)
            else:
                divisor = self._frequencies.sum(axis=1)[:, np.newaxis]
            divisor[divisor == 0] = 1             # Prevent division errors
            self._frequencies /= divisor
            self._errors2 /= (divisor * divisor)  # Has its limitations
            return self
def partial_normalize ( self , axis : AxisIdentifier = 0 , inplace : bool = False ) : axis = self . _get_axis ( axis ) if not inplace : copy = self . copy ( ) copy . partial_normalize ( axis , inplace = True ) return copy else : self . _coerce_dtype ( float ) if axis == 0 : divisor = self . _frequencies . sum ( axis = 0 ) else : divisor = self . _frequencies . sum ( axis = 1 ) [ : , np . newaxis ] divisor [ divisor == 0 ] = 1 self . _frequencies /= divisor self . _errors2 /= ( divisor * divisor ) return self
Normalize in rows or columns.

        Parameters
        ----------
        axis: int or str
            Along which axis to sum (numpy-sense)
        inplace: bool
            Update the object itself

        Returns
        -------
        hist : Histogram2D