obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
A2 python basics_nptel_pds2_sol
1. NPTEL – PYTHON FOR DATA SCIENCE
ASSIGNMENT 2 – SOLUTION
1. Answer C: Tuples
Tuples is defined by enclosing the elements in parentheses ‘()’
2. Answer B: numpy arrays are immutable
Numpy Arrays are mutable, which means that you can change the value of an
element in the array after an array has been initialized.
3. Answer C: print (a[-1])
4. Answer D: x = np.arange(10); x[5::-2]
5. Answer C: 8,9,15
6. Answer C: extend()
extend () is the method used to increase the length of the list by number of
elements in its argument.
7. Answer A: np.argsort ()
np.argsort () returns the indices that would sort an array
2. 8. Answer C: tuple[3] = 45
'tuple' object does not support item assignment
9. Answer A: len(N) & C: np.size(N)
10.Answer C: M = set([11,12],[13,14],[14,15])
11.Answer D: S={13,14}
12.Answer A: a | b
Union is performed using | operator in python
13.Answer B: Gives the number of axes or dimensions in the array
ndarray.ndim gives the number of axes or dimensions in the array
14.Answer C: d["oranges "] = 0.90
3. 15.Answer D: all of the above
np.concatenate, np.hstack, and np.vstack help in joining arrays
16.Answer B: { 1: 2, '1': 2 }
17.Answer C: [0, 1, 4, 9]
18.Answer C: 8
19. Which of the following is not possible in sequence datatypes?
Answer B: Create a list inside a set
Create a list inside a set is not possible in sequence datatypes