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