complex_random_sample[source]

complex_random_sample(shape_tuple)

A complex analogue of the random_sample numpy function. Inputs shape_tuple : tuple Tuple containing the dimensions of the final complex array.

Outputs : crs : ndarray the complex random array of the shape as specified in the shape_tuple complex random sample

a = complex_random_sample((9, 10))
a.shape
(9, 10)
a[2, :]
array([0.12559043+0.61128892j, 0.98176724+0.06611767j,
       0.92747246+0.5550274j , 0.26733615+0.58556844j,
       0.74813903+0.95508615j, 0.25118439+0.44896451j,
       0.61431219+0.85576325j, 0.76634345+0.75247612j,
       0.61044008+0.7172695j , 0.15333995+0.3864839j ])
a[2, :].shape
(10,)
a[:, 6]
array([0.07218142+0.95199211j, 0.40860741+0.36601322j,
       0.61431219+0.85576325j, 0.00307163+0.01805683j,
       0.17077774+0.29645294j, 0.0091934 +0.19979313j,
       0.56401595+0.9898702j , 0.09139743+0.98470297j,
       0.5328866 +0.98674838j])
a[:, 6].shape
(9,)
a[:, 6].reshape(3, 3)
array([[0.07218142+0.95199211j, 0.40860741+0.36601322j,
        0.61431219+0.85576325j],
       [0.00307163+0.01805683j, 0.17077774+0.29645294j,
        0.0091934 +0.19979313j],
       [0.56401595+0.9898702j , 0.09139743+0.98470297j,
        0.5328866 +0.98674838j]])
a.reshape(3, 3, a.shape[-1])[:, :, 6]
array([[0.07218142+0.95199211j, 0.40860741+0.36601322j,
        0.61431219+0.85576325j],
       [0.00307163+0.01805683j, 0.17077774+0.29645294j,
        0.0091934 +0.19979313j],
       [0.56401595+0.9898702j , 0.09139743+0.98470297j,
        0.5328866 +0.98674838j]])
assert_allclose(a.reshape(3, 3, a.shape[-1])[:, :, 6], a[:, 6].reshape(3, 3))

Try changing any of the 6 in the above line to 7