hazelheil4219 hazelheil4219
  • 04-11-2020
  • Computers and Technology
contestada

Write a program named double_trouble.py that contains a 2-D array containing two arrays with the values 1,2,3 and 4,5,6. Check and report on the array's dimensions.

Respuesta :

IfeanyiEze8899 IfeanyiEze8899
  • 05-11-2020

Answer:

import numpy as np

list1 = [1,2,3]

list2 = [4,5,6]

my_array = np.array([list1, list2])

print( my_array )

print( my_array.shape)

Explanation:

To create a 2- dimensional array from two list or arrays, import the numpy package and call the numpy array method with the two arrays as the argument. Print the resultant array and the dimension with the numpy shape attribute.

Answer Link

Otras preguntas

What was unique about the way that the Inca were able to expand their empire?
news article pattern​
Whic conditions are required for a natural selection?
The growth and development of industry in the South a. was nonexistent before the start of the Civil War. b. had a greater impact on the southern economy than a
How are grocery stores helping older Americans
Which functions does the endocrine system help regulate?
Can anyone tell me with this list says couldn’t get the full picture
Mike has swelling in his nasal and sinus tissues. What type of medication will help him with this condition? A. antidiabetic B. decongestant C. diuretic D. anti
Describe U.S. - Vietnamese relations after 1973
Points A, B, and C are on a circle. the measure of arc AB is 165. what is the measure of arc ACB?