Python For Data Science - Unit 4 - Week 2
Python For Data Science - Unit 4 - Week 2
Python For Data Science - Unit 4 - Week 2
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
shashikantkale87@gmail.com
Announcements (announcements)
Unit 4 - Week 2
Register for
Certification
exam Assignment 2
(https://nptelmarchexam.swayam.gov.in/)
Your last recorded submission was on 2020-02-10, Due date: 2020-02-12, 23:59 IST.
13:08 IST
Course
outline MCQ/MSQ – questions can have 1 or more correct answers.
1) Which of the following sequence data type is defined by enclosing the elements in 1 point
How does an parentheses ‘()’?
NPTEL online
course work? Lists
Arrays
Week 0
Tuples
Week 1 Dictionary
2) Which of the following statement is not valid about Numpy ‘Arrays’? 1 point
Week 2
The type of items in the array is specified by a separate data-type object (dtype)
Jupyter setup
numpy arrays are immutable
(unit?
unit=2&lesson=73) numpy arrays can support multidimensional data
ndarray.shape attribute returns a tuple consisting of array dimensions
Sequence_data_part_1 3) The command to access the last element from the array “a” is__ 1 point
(unit?
unit=2&lesson=74)
Sequence_data_part_2
(unit?
unit=2&lesson=75) print (a[0])
Quiz :
Assignment 0,8,9,15
2
(assessment? 8,9,15,17
name=83) 8,9,15
Week 2 - IndexError
FAQs (unit?
6) The method used to increase the length of the list by number of elements in its 1 point
unit=2&lesson=91)
argument.
Week 2
Feedback add ()
(unit? insert ()
unit=2&lesson=85)
extend ()
Week 3 pop ()
7) The function that returns the indices of the sorted elements. 1 point
Download
Videos
np.argsort ()
np.sort ()
np.bogosort ()
np.selectionsort ()
8) Create two tuples 1 point
Find out which of the following code does not work on a tuple
tuple+tuple1
sum(tuple)
tuple[3] = 45
len(tuple)
9) The command to find the number of elements in the following array “N” is 1 point
len(N)
N.count()
np.size(N)
N.size()
10)Which of the following is not a valid syntax for creating a Set ‘M’ in Python? 1 point
M = set ([11,12,12,13,14,15])
M = {11,12,13,14}
M = set ([11,12],[13,14],[14,15])
M = set ((11,12,13,14))
11)What will be the output after executing the following codes? 1 point
12)Which of the following command returns the set of all elements from both sets, a and 1 point
b?
a^b
a&b
a|b
a–b
d[2] = 0.90
d[0.50] = 0.90
d["oranges "] = 0.90
d["plum "] = 0.90
np.concatenate
np.hstack
np.vstack
all of the above
{ 1: 1 }
{ 1: 2, '1': 2 }
{ 1: 0; ‘1’: 2 }
{ 1: 1, '1': 2 }
[1, 4, 9]
[1, 4, 9, 16]
[0, 1, 4, 9]
[0, 1, 4, 9, 16]
18)The output of the code given below is 1 point
list = [2, 4, 6, 8]
a = (x**3 for x in list)
print(next(a))
4
6
8
64
20)Which of the following commands will give you a new numpy array with Boolean 1 point
values?
np.ones((3,3),True)
np.zeros((3,3),False)
np.arange((3,3),False)
np.full((3,3),True)
You may submit any number of times before the due date. The final submission will be
considered for grading.
Submit Answers