@@ -5923,7 +5923,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
5923
5923
5924
5924
Default is ``None``
5925
5925
5926
- normed or density : boolean, optional
5926
+ normed, density : boolean, optional
5927
5927
Either the 'normed' or the 'density' arg can be set to
5928
5928
accomplish this behavior:
5929
5929
@@ -5945,19 +5945,21 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
5945
5945
weights : (n, ) array_like or None, optional
5946
5946
An array of weights, of the same shape as `x`. Each value in `x`
5947
5947
only contributes its associated weight towards the bin count
5948
- (instead of 1). If `normed` and/or 'density' is True, the weights are normalized,
5949
- so that the integral of the density over the range remains 1.
5948
+ (instead of 1). If `normed` and/or 'density' is True,
5949
+ the weights are normalized, so that the integral of the density
5950
+ over the range remains 1.
5950
5951
5951
5952
Default is ``None``
5952
5953
5953
5954
cumulative : boolean, optional
5954
5955
If `True`, then a histogram is computed where each bin gives the
5955
5956
counts in that bin plus all bins for smaller values. The last bin
5956
- gives the total number of datapoints. If `normed` and/or 'density' is also `True`
5957
- then the histogram is normalized such that the last bin equals 1.
5958
- If `cumulative` evaluates to less than 0 (e.g., -1), the direction
5959
- of accumulation is reversed. In this case, if `normed` and/or 'density' is also
5960
- `True`, then the histogram is normalized such that the first bin
5957
+ gives the total number of datapoints. If `normed` and/or 'density'
5958
+ is also `True` then the histogram is normalized such that the last
5959
+ bin equals 1. If `cumulative` evaluates to less than 0 (e.g., -1),
5960
+ the direction of accumulation is reversed. In this case, if
5961
+ `normed` and/or 'density' is also `True`, then the histogram is
5962
+ normalized such that the first bin
5961
5963
equals 1.
5962
5964
5963
5965
Default is ``False``
@@ -6077,12 +6079,14 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6077
6079
6078
6080
"""
6079
6081
6080
- # This sets the density variable, if necessary, to its predecessor, 'normed.'
6081
- if density != None and normed != None and density != normed :
6082
- raise ValueError ('The density and normed arguments represent the same concept. Please set only one of them, or set them to the same value.' )
6083
- elif normed != None and density == None :
6082
+ # Sets the density variable, if necessary, to its predecessor, 'normed.'
6083
+ if density is not None and normed is not None and density is not normed :
6084
+ raise ValueError ('The density and normed arguments represent the '
6085
+ 'same concept. Please set only one of them, or '
6086
+ 'set them to the same value.' )
6087
+ elif normed is not None and density is None :
6084
6088
density = normed
6085
- elif normed == None and density == None :
6089
+ elif normed is None and density is None :
6086
6090
density = False
6087
6091
6088
6092
def _normalize_input (inp , ename = 'input' ):
0 commit comments