Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python, solve in as few lines as possible ( each can be done in one line ) Problem 2 : Construct a matrix C

In python, solve in as few lines as possible (each can be done in one line)Problem 2: Construct a matrix C with C[i,j]=1x[i]+y[j].
In []: x= np. linspace (1,2,6)
y = np. linspace )
# Write your code below
Problem 3: Each row of x and Y is the coordinates of a 2D-point. Construct the matrix D, such that D[i,j] is the distance between x[i] and
Y[j].
In [3]: x
Y
#
Problem 4. Generate a random matrix of mm, with roughly half of the entries 0, and the remaining entries are integers chosen from 1,2 and 3.
In []:m=5
# Write your code here
Problem 5. Generate a random nn matrix whose entries above the main diagonal are positive, while the entries below the main diagonal are all
negative.
In []: n=5
# Write your code here
Problem 6. Muptiple each row of x whose index is given in I by 2.
In []: A= np. random. rand (4,4)
#print (A)
I=[0,1,1,2]
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

List the main reasons why firms repurchase shares.

Answered: 1 week ago

Question

How is trade involved in a brands IMC?

Answered: 1 week ago