Generate numbers in the range [0, 1). Generated values are uniformly-distributed, double-precision in range [0, 1). Algorithm and seed can be changed via RandomOptions. Parameters ---------- n : int Number of values to generate, must be greater than or equal to 0
(n, *, initializer='system', options=None, memory_pool=None)
| 673 | |
| 674 | |
| 675 | def random(n, *, initializer='system', options=None, memory_pool=None): |
| 676 | """ |
| 677 | Generate numbers in the range [0, 1). |
| 678 | |
| 679 | Generated values are uniformly-distributed, double-precision |
| 680 | in range [0, 1). Algorithm and seed can be changed via RandomOptions. |
| 681 | |
| 682 | Parameters |
| 683 | ---------- |
| 684 | n : int |
| 685 | Number of values to generate, must be greater than or equal to 0 |
| 686 | initializer : int or str |
| 687 | How to initialize the underlying random generator. |
| 688 | If an integer is given, it is used as a seed. |
| 689 | If "system" is given, the random generator is initialized with |
| 690 | a system-specific source of (hopefully true) randomness. |
| 691 | Other values are invalid. |
| 692 | options : pyarrow.compute.RandomOptions, optional |
| 693 | Alternative way of passing options. |
| 694 | memory_pool : pyarrow.MemoryPool, optional |
| 695 | If not passed, will allocate memory from the default memory pool. |
| 696 | """ |
| 697 | options = RandomOptions(initializer=initializer) |
| 698 | return call_function("random", [], options, memory_pool, length=n) |
| 699 | |
| 700 | |
| 701 | def field(*name_or_index): |
no outgoing calls