Write a Numpy program to create a 3x3 identity matrix, i.e. diagonal elements are 1, the rest are 0. Replace all 0 to random number from 10 to 20 -Technology

1 Answer

Answer :

import numpy as nparray1=np.identity(3)print(array1)x=np.where(array1==0)for i in x:array1[x]=np.random.randint(low=10,high=20)print(array1)

Related questions

Description : Write a Numpy program to create a 3x3 identity matrix, i.e. non diagonal elements are 1, the rest are 0. Replace all 0 to random number from 1 to 10 -Technology

Last Answer : import numpy as npZ = np.arange(9).reshape(3,3)print (Z)x=np.where((Z%2)==0)for i in x:Z[x]=np.random.randint(low=10,high=20)print(Z)

Description : Write a numPy program to create a numPy array with all values as True printed 10 times. -Technology

Last Answer : This answer was deleted by our moderators...

Description : Python: create an empty Numpy array/matrix -Web-Development

Last Answer : answer:

Description : Transpose of a column matrix is a.Zero matrix b.Identity matrix c.Row matrix d.Diagonal matrix

Last Answer : c.Row matrix

Description : Let A be a `2xx2` matrix with real entries. Let I be the `2xx2` identity matrix. Denote by tr (A), the sum of diagonal entries of A. Assume that `A^2=

Last Answer : Let A be a `2xx2` matrix with real entries. Let I be the `2xx2` identity matrix. Denote by tr (A) ... D. Statement -1 is false, statement -2 is true.

Description : 3X3 inverse of matrix short trick

Last Answer : 3X3 inverse of matrix short trick

Description : Name the diagonal elements and off diagonal elements of bus impedance matrix.

Last Answer : The diagonal elements of bus impedance matrix are called driving point impedances of the buses and off diagonal elements of bus impedance matrix are called transfer impedances of the buses.

Description : Name the diagonal and off diagonal elements of bus admittance matrix.

Last Answer : The diagonal elements of bus admittance matrix are called self admittances of the buses and off diagonal elements are called mutual admittances of the buses.

Description : For stable structures, one of the important properties of flexibility and stiffness matrices is that the elements on the main diagonal (i) Of a stiffness matrix must be positive (ii) Of a stiffness matrix must be negative (iii) Of ... ) (B) (ii) and (iii) (C) (i) and (iv) (D) (ii) and (iv)

Last Answer : (A) (i) and (iii)

Description : The diagonal elements of a nodal admittance matrix are strengthened by adding :  (A) Shunt capacitors (C) Generators (B) Shunt inductances (D) Resistive loads

Last Answer : A

Description : How to convert a 2D Python list to Numpy matrix -Web-Development

Last Answer : answer:

Description : Fill in the blank with appropriate numpy method to calculate and print the variance of an array. -Technology

Last Answer : print(np.var(data,ddof=0))

Description : Python: How to get the indices of several elements in a list or numpy array at once? -Web-Development

Last Answer : answer:

Description : Python : How to find the indices of elements in a sublist in a list or numpy array -Web-Development

Last Answer : answer:

Description : Consider a given Series , M1: Write a program in Python Pandas to create the series. -Technology

Last Answer : import pandas as pdm1=pd.Series([45,65,24,89],index=['term1','term2','t erm3','term4'])

Description : Write a program in Python Pandas to create the following DataFrame batsman from a Dictionary: B_NO Name Score1 Score2 -Technology

Last Answer : Alternative Answer

Description : Statement 1: The product of two diagonal matrices of order 3 is also a diagonal matrix. Statement -2 : In general, matrix multiplication is non-commut

Last Answer : Statement 1: The product of two diagonal matrices of order 3 is also a diagonal matrix. Statement -2 ... Statement -1 is false, statement -2 is true.

Description : Which of the following is true about Stiffness matrix a. Diagonal matrix b. Symmetric matrix c. Positive Definite d. All of the above

Last Answer : d. All of the above

Description : Ram wants to create a text file to store name and roll number of his students. Suggest, which program he should use. -Technology

Last Answer : He can create a text file using Notepad or WordPad. Follow these steps to create a file using Notepad:(a) Step 1:Click Start.(b) Step 2:Choose All Programs -> Accessories -> Notepad.(c) Step 3: ... dialog box will appear.(g) Step 7:Give file name with extension.(h) Step 8: Click Save button.

Description : Write an HTML code to create the following table: 100 Amit 10 A -Technology

Last Answer : The HTML code is Roll NumberNameClass 100 Amit 10 A 101 Ankit 10 B 102 Arnab 10C Footer 1 Footer 2 Footer 3

Description : A digital code attached to an electronic message to provide it unique identity is called ………… -Technology

Last Answer : A digital code attached to an electronic message to provide it unique identity is calleddigital signature.

Description : Trademark is the registered ………………… depicting the identity of a product, work or company. -Technology

Last Answer : Trademark is the registered word or text/logo depicting the identity of a product, work or company.

Description : What do you mean by Identity theft? Explain with the help of an example. -Technology

Last Answer : Identity theft is the crime of obtaining the personal or financial information of another person for the sole purpose of assuming that person's name or identity to make transactions or use it to ... using the computer. He used Flex's email account to send inappropriate messages to his contacts.

Description : Write a program to create a vector with five elements as (5, 15, 25, 35, 45). Insert new element at 2nd position. Remove 1st and 4th element from vector.

Last Answer : import java.util.*; class VectorDemo { public static void main(String[] args) { Vector v = new Vector(); v.addElement(new Integer(5)); v.addElement(new Integer(15)); v.addElement(new ... .addElement(new Integer(45)); System.out.println("Original array elements are "); for(int i=0;i

Description : x4+3x3+3x2+x+1 -Maths 9th

Last Answer : Solution: Let p(x)= x4+3x3+3x2+x+1 The zero of x+1 is -1. p(−1)=(−1)4+3(−1)3+3(−1)2+(−1)+1 =1−3+3−1+1 =1 ≠ 0 ∴By factor theorem, x+1 is not a factor of x4+3x3+3x2+x+1

Description : 3. Check whether 7+3x is a factor of 3x3+7x. -Maths 9th

Last Answer : Solution: 7+3x = 0 ⇒ 3x = −7 ⇒ x = -7/3 ∴Remainder: 3(-7/3)3+7(-7/3) = -(343/9)+(-49/3) = (-343-(49)3)/9 = (-343-147)/9 = -490/9 ≠ 0 ∴7+3x is not a factor of 3x3+7x

Description : Find the value of the polynomial 3x3 – 4x2 + 7x – 5, when x = 3 and also when x = -3. -Maths 9th

Last Answer : Let p(x) =3x3 – 4x2 + 7x – 5 At x= 3, p(3) = 3(3)3 – 4(3)2 + 7(3) – 5 = 3×27-4×9 + 21-5 = 81-36+21-5 P( 3) =61 At x = -3, p(-3)= 3(-3)3 – 4(-3)2 + 7(-3)- 5 = 3(-27)-4×9-21-5 = -81-36-21-5 = -143 p(-3) = -143 Hence, the value of the given polynomial at x = 3 and x = -3 are 61 and -143, respectively.

Description : Find the value of the polynomial 3x3 – 4x2 + 7x – 5, when x = 3 and also when x = -3. -Maths 9th

Last Answer : Let p(x) =3x3 – 4x2 + 7x – 5 At x= 3, p(3) = 3(3)3 – 4(3)2 + 7(3) – 5 = 3×27-4×9 + 21-5 = 81-36+21-5 P( 3) =61 At x = -3, p(-3)= 3(-3)3 – 4(-3)2 + 7(-3)- 5 = 3(-27)-4×9-21-5 = -81-36-21-5 = -143 p(-3) = -143 Hence, the value of the given polynomial at x = 3 and x = -3 are 61 and -143, respectively.

Description : Does the numerical expression of (2x4)+(3x3) have a value of 33?

Last Answer : 172x4=8+(3x3)=173x3=99+8=17

Description : What is the exponential form of 3x3?

Last Answer : 3^2

Description : What size rectangular floor can be completely covered by using 3x3 ft tiles or 5x5 ft tiles you cant cut tiles or combine them?

Last Answer : A 3 x 5 rectangle.

Description : What size rectangular floor can be completely covered by using 3x3 ft tiles or 5x5 ft tiles you cant cut tiles or combine them?

Last Answer : A 3 x 5 rectangle.

Description : Python: how to convert a Numpy array of values True/False to 1/0 -Web-Development

Last Answer : answer:

Description : Dot Matrix is a type of (a) Tape (b) Disk (c) Printer (d) Bus -Technology

Last Answer : (c) Dot matrix is a type of impact printer that prints one character at a time.

Description : The value of off diagonal elements is a) sum of admittances connected at bus j b) which is connected between bus i and bus j with positive sign c) which is connected between bus i and bus j with negative sign d) sum of admittances connected at bus i

Last Answer : c) which is connected between bus i and bus j with negative sign

Description : In a square of side 10 cm, its diagonal is equal to (a) 15 cm (b) 10√2 cm (c) 20 cm (d) 12 cm

Last Answer : (b) 10√2 cm

Description : According to I.S. : 456 specifications, the safe diagonal tensile stress for M 150 grade concrete, is (A) 5 kg/cm2 (B) 10 kg/cm2 (C) 15 kg/cm2 (D) 20 kg/cm

Last Answer : Answer: Option A

Description : Point out the correct statement. a) Mashups are an incredibly useful hybrid Web application b)SaaS will eventually replace all locally installed software c) The establishment and proof of identity is a central network function d) All of the mentioned

Last Answer : All of the mentioned

Description : Write the HTML code to create a paragraph whose text color is blue. -Technology

Last Answer : or

Description : Write the HTML code to create a link for school .jpg located at C:\. -Technology

Last Answer : Image

Description : Write the HTML code to create the exact table which is given below: ADMNO SNAME NAME DOB -Technology

Last Answer : The HTML code is ADMNO SNAMENAMEDOB1110MANJITRANJIT4-MAR-1998

Description : Write the complete … tags to create a table with the following contents. -Technology

Last Answer :

Description : Write the steps to create a new document. -Technology

Last Answer : Steps to create a new blank document are as follows:(a) Step 1: Click the Microsoft Office button.(b) Step 2: Select New, the New Document dialog box will appear as shown below:(c) Step 3: ... (It will be highlighted bydefault).(d) Step 4: Click Create button, a new blank document will appear.

Description : Write SQL query to create a table “BOOKS” with the following structure: Table: BOOKS -Technology

Last Answer : Create table Books(BOOK_ID Integer (2) Primary Key,BOOK_NAME Varchar (20),CATEGORY Varchar (20),ISSUE_DATE Date);

Description : Write SQL query to create a table “Registration” with the following structure: -Technology

Last Answer : Create table Registration(Reg_Id Integer(2) Primary Key,Name varchar(20),Course varchar(10),Join_Dt date);

Description : Write a python code to create a data frame with appropriate headings from the list given below : -Technology

Last Answer : import pandas as pd# initialize list of listsdata = [['S101', 'Amy', 70], ['S102', 'Bandhi', 69], ['S104','Cathy', 75], ['S105', 'Gundaho', 82]]# Create the pandas DataFramdf = pd.DataFrame(data, columns = ['ID', 'Name', 'Marks'])# printdataframe. print(df )

Description : Write a small python codeto create a dataframewith headings(a and b) from the list given below : [[1,2],[3,4],[5,6],[7,8]] -Technology

Last Answer : import pandas as pddf = pd.DataFrame([[1, 2], [3, 4]], columns = ['a','b'])df2 = pd.DataFrame([[5, 6], [7, 8]], columns = ['a','b'])df = df.append(df2)

Description : Write SQL query to create a table Inventory with the following structure : -Technology

Last Answer : CREATE TABLE Inventory(Material Id Integer Primary Key,Material Varchar (50) NOT NULL,Category Char,DatePurchase Date) :

Description : Write SQL query to create a table Player with the following structure : -Technology

Last Answer : CREATE TABLE Player(};

Description : In Random Access Memory if current will be interrupted, data will not lost. -Technology

Last Answer : FalseRandom Access Memory (RAM) is a volatile memory, if current is interrupted, data will lost.