@@ -261,7 +261,7 @@ cdef class Generator:
261
261
262
262
def random (self , size = None , dtype = np .float64 , out = None ):
263
263
"""
264
- random(size=None, dtype='d' , out=None)
264
+ random(size=None, dtype=np.float64 , out=None)
265
265
266
266
Return random floats in the half-open interval [0.0, 1.0).
267
267
@@ -277,10 +277,9 @@ cdef class Generator:
277
277
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
278
278
``m * n * k`` samples are drawn. Default is None, in which case a
279
279
single value is returned.
280
- dtype : {str, dtype}, optional
281
- Desired dtype of the result, either 'd' (or 'float64') or 'f'
282
- (or 'float32'). All dtypes are determined by their name. The
283
- default value is 'd'.
280
+ dtype : dtype, optional
281
+ Desired dtype of the result, only `float64` and `float32` are supported.
282
+ Byteorder must be native. The default value is np.float64.
284
283
out : ndarray, optional
285
284
Alternative output array in which to place the result. If size is not None,
286
285
it must have the same shape as the provided size and must match the type of
@@ -416,7 +415,7 @@ cdef class Generator:
416
415
417
416
def standard_exponential (self , size = None , dtype = np .float64 , method = u'zig' , out = None ):
418
417
"""
419
- standard_exponential(size=None, dtype='d' , method='zig', out=None)
418
+ standard_exponential(size=None, dtype=np.float64 , method='zig', out=None)
420
419
421
420
Draw samples from the standard exponential distribution.
422
421
@@ -430,9 +429,8 @@ cdef class Generator:
430
429
``m * n * k`` samples are drawn. Default is None, in which case a
431
430
single value is returned.
432
431
dtype : dtype, optional
433
- Desired dtype of the result, either 'd' (or 'float64') or 'f'
434
- (or 'float32'). All dtypes are determined by their name. The
435
- default value is 'd'.
432
+ Desired dtype of the result, only `float64` and `float32` are supported.
433
+ Byteorder must be native. The default value is np.float64.
436
434
method : str, optional
437
435
Either 'inv' or 'zig'. 'inv' uses the default inverse CDF method.
438
436
'zig' uses the much faster Ziggurat method of Marsaglia and Tsang.
@@ -470,7 +468,7 @@ cdef class Generator:
470
468
471
469
def integers (self , low , high = None , size = None , dtype = np .int64 , endpoint = False ):
472
470
"""
473
- integers(low, high=None, size=None, dtype=' int64' , endpoint=False)
471
+ integers(low, high=None, size=None, dtype=np. int64, endpoint=False)
474
472
475
473
Return random integers from `low` (inclusive) to `high` (exclusive), or
476
474
if endpoint=True, `low` (inclusive) to `high` (inclusive). Replaces
@@ -495,11 +493,9 @@ cdef class Generator:
495
493
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
496
494
``m * n * k`` samples are drawn. Default is None, in which case a
497
495
single value is returned.
498
- dtype : {str, dtype}, optional
499
- Desired dtype of the result. All dtypes are determined by their
500
- name, i.e., 'int64', 'int', etc, so byteorder is not available
501
- and a specific precision may have different C types depending
502
- on the platform. The default value is `np.int_`.
496
+ dtype : dtype, optional
497
+ Desired dtype of the result. Byteorder must be native.
498
+ The default value is np.int64.
503
499
endpoint : bool, optional
504
500
If true, sample from the interval [low, high] instead of the
505
501
default [low, high)
@@ -976,7 +972,7 @@ cdef class Generator:
976
972
# Complicated, continuous distributions:
977
973
def standard_normal (self , size = None , dtype = np .float64 , out = None ):
978
974
"""
979
- standard_normal(size=None, dtype='d' , out=None)
975
+ standard_normal(size=None, dtype=np.float64 , out=None)
980
976
981
977
Draw samples from a standard Normal distribution (mean=0, stdev=1).
982
978
@@ -986,10 +982,9 @@ cdef class Generator:
986
982
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
987
983
``m * n * k`` samples are drawn. Default is None, in which case a
988
984
single value is returned.
989
- dtype : {str, dtype}, optional
990
- Desired dtype of the result, either 'd' (or 'float64') or 'f'
991
- (or 'float32'). All dtypes are determined by their name. The
992
- default value is 'd'.
985
+ dtype : dtype, optional
986
+ Desired dtype of the result, only `float64` and `float32` are supported.
987
+ Byteorder must be native. The default value is np.float64.
993
988
out : ndarray, optional
994
989
Alternative output array in which to place the result. If size is not None,
995
990
it must have the same shape as the provided size and must match the type of
@@ -1042,7 +1037,6 @@ cdef class Generator:
1042
1037
return double_fill (& random_standard_normal_fill , & self ._bitgen , size , self .lock , out )
1043
1038
elif _dtype == np .float32 :
1044
1039
return float_fill (& random_standard_normal_fill_f , & self ._bitgen , size , self .lock , out )
1045
-
1046
1040
else :
1047
1041
raise TypeError ('Unsupported dtype %r for standard_normal' % _dtype )
1048
1042
@@ -1150,7 +1144,7 @@ cdef class Generator:
1150
1144
1151
1145
def standard_gamma (self , shape , size = None , dtype = np .float64 , out = None ):
1152
1146
"""
1153
- standard_gamma(shape, size=None, dtype='d' , out=None)
1147
+ standard_gamma(shape, size=None, dtype=np.float64 , out=None)
1154
1148
1155
1149
Draw samples from a standard Gamma distribution.
1156
1150
@@ -1166,10 +1160,9 @@ cdef class Generator:
1166
1160
``m * n * k`` samples are drawn. If size is ``None`` (default),
1167
1161
a single value is returned if ``shape`` is a scalar. Otherwise,
1168
1162
``np.array(shape).size`` samples are drawn.
1169
- dtype : {str, dtype}, optional
1170
- Desired dtype of the result, either 'd' (or 'float64') or 'f'
1171
- (or 'float32'). All dtypes are determined by their name. The
1172
- default value is 'd'.
1163
+ dtype : dtype, optional
1164
+ Desired dtype of the result, only `float64` and `float32` are supported.
1165
+ Byteorder must be native. The default value is np.float64.
1173
1166
out : ndarray, optional
1174
1167
Alternative output array in which to place the result. If size is
1175
1168
not None, it must have the same shape as the provided size and
0 commit comments