File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1068,7 +1068,7 @@ cdef class RandomState:
1068
1068
if pop_size is 0 :
1069
1069
raise ValueError (" a must be non-empty" )
1070
1070
1071
- if None ! = p :
1071
+ if p is not None :
1072
1072
d = len (p)
1073
1073
p = < ndarray> PyArray_ContiguousFromObject(p, NPY_DOUBLE, 1 , 1 )
1074
1074
pix = < double * > PyArray_DATA(p)
@@ -1090,7 +1090,7 @@ cdef class RandomState:
1090
1090
1091
1091
# Actual sampling
1092
1092
if replace:
1093
- if None ! = p :
1093
+ if p is not None :
1094
1094
cdf = p.cumsum()
1095
1095
cdf /= cdf[- 1 ]
1096
1096
uniform_samples = self .random_sample(shape)
@@ -1103,7 +1103,7 @@ cdef class RandomState:
1103
1103
raise ValueError (" Cannot take a larger sample than "
1104
1104
" population when 'replace=False'" )
1105
1105
1106
- if None ! = p :
1106
+ if p is not None :
1107
1107
if np.count_nonzero(p > 0 ) < size:
1108
1108
raise ValueError (" Fewer non-zero entries in p than size" )
1109
1109
n_uniq = 0
You can’t perform that action at this time.
0 commit comments