1-D Arrays1-D Arrays

How about more complex arrays? What is a one-dimensional array?

One-dimensional array is a table of elements, all of the same type, indexed by sequences of natural numbers. Let's take a look at the example of creating a 1-D array:

Example

Note the syntax for creating a 1-dimensional array. Unlike a 0-dimensional array, here we need to call the np.array() function and enclose your 1-dimensional array in parentheses, which is enclosed in square brackets. Like this example: np.array([value1, value2, value3]).

question-icon

Select all options with the INCORRECT code of creating 1-d array.

Select a few correct answers

Everything was clear?

Section 2. Chapter 4