Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume NumPy is loaded under the alias np . This code initializes and prints array: array = np . array ( [ [ ' a

Assume NumPy is loaded under the alias np. This code initializes and prints array:
array = np.array([['a','a'],['b','b'],['c','c']])
print(array)
[['a''a']
['b''b']
['c''c']]
The following questions modify array and print the result. Fill in the blank to complete the code.
1)
array2= np.______(array,0,'z', axis=1)
print(array2)
[['z''a''a']
['z''b''b']
['z''c''c']]
Check
Show answer
2)
array2= np.insert(array,0,'z',______)
print(array2)
[['z''z']
['a''a']
['b''b']
['c''c']]
Check
Show answer
3)
array2= np.______(array,1, axis=0)
print(array2)
[['a''a']
['c''c']]
Check
Show answer
4)
array2= np.sort(array,____)
print(array2)
['a''a''b''b''c''c']

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

Write a letter asking them to refund your $1,500 down payment.

Answered: 1 week ago