Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele 1-D Arrays | Dimensions in Arrays
NumPy in a Nutshell

book1-D Arrays

A one-dimensional array is a collection of elements, all of the same type, indexed by sequences of natural numbers.

Let's have a look at an example of creating a 1-D array:

1234567
import numpy as np # Creating array arr = np.array([1, 2, 0, 0]) # Displaying array print(arr)
copy

Note

We should use the np.array() function and enclose your 1-dimensional array in square brackets. For example: np.array([value1, value2, value3]).

question mark

Select all options with the INCORRECT code for creating a 1-D array.

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 1

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Awesome!

Completion rate improved to 4.76

book1-D Arrays

Pyyhkäise näyttääksesi valikon

A one-dimensional array is a collection of elements, all of the same type, indexed by sequences of natural numbers.

Let's have a look at an example of creating a 1-D array:

1234567
import numpy as np # Creating array arr = np.array([1, 2, 0, 0]) # Displaying array print(arr)
copy

Note

We should use the np.array() function and enclose your 1-dimensional array in square brackets. For example: np.array([value1, value2, value3]).

question mark

Select all options with the INCORRECT code for creating a 1-D array.

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 1
some-alt