ADVERTISEMENT

Observe the following code and identify what will be the outcome (4)?

10. Observe the following code and identify what will be the outcome?

import numpy as np 

a = np.array([10, 20, 30, 40])
b = np.array([18, 15, 14])
c = np.array([25, 24, 26, 28, 23])

x, y, z = np.ix_(a, b, c)

print(x)
  1. [[[10]]
    
     [[20]]
    
     [[30]]
    
     [[40]]]
  2. [[[1]]
    
     [[2]]
    
     [[3]]
    
     [[4]]
    
     [[5]]] 
  3. [[[18]]
    
     [[15]]
    
     [[[14]]]
  4. None of the mentioned above

Answer: A)

[[[10]]

 [[20]]

 [[30]]

 [[40]]] 

Explanation:

To acquire the result for each n-uplet, the ix_ function can be used to mix different vectors together in one operation. In this case, if you wish to compute all of the a+b*c for all of the triplets derived from each of the vectors a, b, and c.

Comments and Discussions!




ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.