Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Numpy random number
#1
I am a beginner of Python. And I am a bit confused by different way of generating random numbers. Appreciate if anyone can explain the difference below:

import numpy as np
a1 = np.random.random((1,4))
a2 = np.random.random(4)
Thank you!
Reply


Messages In This Thread
Numpy random number - by Bryant - Jul-22-2017, 11:08 AM
RE: Numpy random number - by MTVDNA - Jul-23-2017, 11:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 694 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,671 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 3,026 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  counting the occurence of a specified number in a numpy-matrix PhysChem 1 2,428 Apr-03-2019, 01:37 PM
Last Post: PhysChem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020