NPTEL Python for Data Science Assignment 2 Answers 2022

Python for Data Science Assignment 2

NPTEL Python for Data Science Assignment 2 Answers:- Hello students in this article we are going to share NPTEL Python for Data Science assignment week 2 answers. All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

Below you can find NPTEL Python for Data Science Assignment 2 Answers

Assignment No.Answers
Python for Data Science Assignment 1 Click Here
Python for Data Science Assignment 2 Click Here
Python for Data Science Assignment 3 Click Here
Python for Data Science Assignment 4 Click Here
Python for Data Science Assignment 5 Click Here
Python for Data Science Assignment 6 Click Here
Python for Data Science Assignment 7 Click Here
Python for Data Science Assignment 8 Click Here

NPTEL Python for Data Science Assignment 2 Answers 2022:-

Q1. Which of the following function(s) can be used to resize a NumPy array in Python from the given options.

a. array.shape(reshape)
b. array.reshape(shape)
c. numpy.reshape(array, shape)
d. numpy.reshape(shape, array)

Answers:- b,c

Q2. Create the tuples given below:

tuple_1 = (1,5,6,7,8)
tuple_2 = (8,9,4)

Identify which of the following options does not work on the given tuples

a. sum(tuple_1)
b. len(tuple_2)
c. tuple_2 + tuple_1
d. tuple_2 + tuple_1

Answers:- d

Q3. Create a sequence of numbers from 15 to 25 and increment by 4. What is the index of the element 19?

a. 3
b. 2
c. 0
d. 1

Answers:- d

Q4. Consider a variable job = “chemist”. Which of the following expression(s) will retrieve the last character from the string?

a. job[7]
b. job[len(job) – 1]
c. job[5:6]
d. job[- 1]

Answers:- b,d

Next Week Assignment Answers

quizxp telegram

Q5. Given a list, ls = [1, 2, 3, 3, 2, 3, 1, 4, 5, 6, 5, 6, 3, 2, 1, 1, 1, 7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 8, 9, 10, 10, 1, 2, 3, 9, 10], which of the following would be the most efficient method in determining the unique elements present in ls?

a. By converting ls into a NumPy array, and applying relevant methods
b. By converting ls into a set
C. By iterating through ls, and doing appropriate manipulations
d. None of the above

Answers:- b

Q6. Which of the following data structure(s) can be used as a key while creating a dictionary?

a. list
b. str
C. set
d. none

Answers:- b

Q7. Given a dictionary, states = {‘Tamil Nadu’: ‘TN’, ‘Karnataka’: ‘KA’, ‘Kerala’: ‘KL’, ‘Maharashtra’: ‘MH’}, which of the following command(s) is used to remove the key-value pair ‘Karnataka’: ‘KA‘ from it?

a. del states[‘Karnataka’]
b. states.popitem(‘Karnataka’)
c. states.pop(‘Karnataka’)
d. del states[‘Karnataka’:’KA’]

Answers:- a,c

Q8. Which of the following is valid to declare a string literal Shin’ichi to a variable?

a. “Shin’ichi”
b. ‘Shin”ichi’
C. ‘Shin’ichi’
d. None of the above

Answers:- a

Q9. Which of the following commands can be used to create a NumPy array?

a. np.array()
b. np.zeros()
C. np.empty()
d. all of the above

Answers:- d

Q10. Given a NumPy array, arr = np.array([[5,9,10], [7,2,6], [12,8,0]]), find the correct command from the following options to get an output array as [24 15 20]?

a. np.sum(arr)
b. np.sum(arr, axis = 0)
C. np.sum(arr, axis = 1)
d. None of the above

Answers:- c

For More NPTEL Answers:- CLICK HERE

Disclaimer: We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.

if you have any suggestions then comment below or contact us at [email protected]

If you found this article Interesting and helpful, don’t forget to share it with your friends to get this information.NPTEL Python for Data Science Assignment 2 Answers 2022