# How i can get random number as numpy.random.randn()

**URL:** <https://discourse.julialang.org/t/how-i-can-get-random-number-as-numpy-random-randn/37120>\
**Category:** General Usage\
**Tags:** question, numbers, math\
**Created:** [April 6, 2020, 5:07pm UTC](https://discourse.julialang.org/t/how-i-can-get-random-number-as-numpy-random-randn/37120 "2020-04-06T17:07:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neeraj\_Verma\_ASETRAI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/neeraj_verma_asetrai/32/13743_2.png) [@Neeraj\_Verma\_ASETRAI](https://discourse.julialang.org/u/Neeraj_Verma_ASETRAI)\
**Post date:** [April 6, 2020, 5:07pm UTC](https://discourse.julialang.org/t/how-i-can-get-random-number-as-numpy-random-randn/37120/1 "2020-04-06T17:07:23Z")

</div>

How i can get output as numpy for generating random numbers which is closer to both 0 and 1 in Float64

n = np.random.randn()

code in python

```julia
import numpy as np

for i in range(10):
  n = np.random.randn()
  print(n)

```

Output

```julia
-0.4473224332794838
0.5357461715087144
-0.05893440913028454
0.01697798466538489
-0.08155177013294897
1.6251740404687394
0.1333821970422605
0.4256883620078718
-1.2798846308240421
1.1278873504026543

```

as we can see the outputs are closer to both 0 and 1

how i can archive this with Julia code?

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [April 6, 2020, 5:17pm UTC](https://discourse.julialang.org/t/how-i-can-get-random-number-as-numpy-random-randn/37120/2 "2020-04-06T17:17:45Z")

</div>

It’s a good idea to share what you’ve tried so far so folks know how best to help you.

If you’re looking for normally-distributed random numbers (centered around 0.0, going positive and negative but less frequent the farther you get from 0) the function is `randn()` in Julia. The equivilent Julia code would be

```julia
for _ in 1:10
      println(randn())
end

```

Or just `println(randn(10))`.
