Question · Python course · Module 8: Data Science

Creating a NumPy Array

How do you create a NumPy array from a Python list [1, 2, 3, 4, 5]?

Answer options

  • np.list([1, 2, 3, 4, 5])
  • np.array([1, 2, 3, 4, 5])
  • np.create([1, 2, 3, 4, 5])
  • numpy.new([1, 2, 3, 4, 5])

You can check the correct answer by solving this task in the CodeWorlds game.