# NPTEL Python for Data Science Assignment 2 Answers 2023

Hello NPTEL Learners, In this article, you will find NPTEL Python for Data Science Assignment 2 Week 2 Answers 2023. All the Answers are provided below to help the students as a reference don’t straight away look for the solutions, first try to solve the questions by yourself. If you find any difficulty, then look for the solutions.

###### NPTEL Python for Data ScienceAssignment 3 Answers 2023 Join Group👇

Note: We are trying to give our best so please share with your friends also.

## NPTEL Python for Data Science 2 Answers 2023:

#### Q.1. What will be the output of the following:

• [[2 6 10] [4 8 12]]
• [[2 4 6] [8 10 12]]
• [[2 4] [6 8] [10 12]]
• [[2 8] [4 10] [6 12]]

#### Q.2. Let t1 = (1, 2, “tuple”, 4) and t2 = (5, 6,7). Which of the following will not give any error after the execution?

• t1.append(5)
• x = t2[t1[1]]
• t3 = t1 + t2
• t3 = (t1, t2)
• t3 = (list(t1), list(t2))

#### Q.3. Let d1 = {1 : “Pyhton”, 2 : [1, 2, 3]}. Which among the following will not give the error after the execution?

• d1[2].append(4)
• x = d1[0]
• d1[“one”] = 1
• d1.update({‘one’ : 2})
##### NPTEL Python for Data Science Assignment 3 Answers Join Group👇

What will be the output of S1 − S2?

• {1, 2, 3}
• {1, 2, 3, 4}
• {1, 2, “4”}
• {1, 2, 4}

#### Q.5.S1 = “Hello” and S2 = “World”. Which of the following will not return “Hello world”?

• S1 + “ ” + S2
• S1[0 :] + “ ” + S2[0 :]
• “{} {}”.format(S1, S2)
• S1[: −1] + “ ” + S2[: −1]

#### Q.6. Given a NumPy array, arr = np.array([[1, 9, 10], [3, 7, 6], [12, 8, 0]]), find the correct command from the following options to get an output array as [16 24 16]?

• arr[1: 2]
• np.sum(arr, axis = 0)
• np.sum(arr, axis = 1)
• np.sum([[1, 9, 10], [3, 7, 6], [12, 8, 0]])

#### Q.7. mat = np.matrix(“5, 9, 10; 2, 5, 4; 1, 9, 8; 2, 6, 8”)mat1 = np.matrix(“1, 2, 3, 4”)mat2 = np.insert(mat, 1, mat1, axis= 1)print(mat2)

What will be the output of the above command?

• [[5 2 1 2] [1 2 3 4] [9 5 9 6]] [10 4 8 8]]
• [[1 2 3 4] [5 2 1 2] [9 5 9 6]] [10 4 8 8]]
• [[5 1 9 10] [2 2 5 4] [1 3 9 8]] [2 4 6 8]]
• It will give an error.

#### Q.8. student = {‘name’: ‘Jane’, ‘age’: 25, ‘courses’: [‘Math’,‘Statistics’]}Which among the following will return{‘name’: ‘Jane’, ‘age’: 26, ‘courses’: [‘Math’, ‘Statistics’], ‘phone’: ‘123-456’}

• student.update({‘age’ : 26})
• student.update({‘age’ : 26, ‘phone’: ‘123-456’})
• student[‘phone’] = ‘123-456’ student.update({‘age’ : 26})
• None of the above

• 13
• 16
• 15
• 12

#### Q.10. Which of the following data type is immutable?

• list
• set
• tuple
• dictionary
##### NPTEL Python for Data Science Assignment 2 Answers Join Group👇

Disclaimer: This answer is provided by us only for discussion purpose if any answer will be getting wrong don’t blame us. If any doubt or suggestions regarding any question kindly comment. The solution is provided by Chase2learn. This tutorial is only for Discussion and Learning purpose.

#### About NPTEL Python for Data Science Course:

The course aims at equipping participants to be able to use python programming for solving data science problems.

##### Course Outcome:
• Week 1:
• BASICS OF PYTHON SPYDER (TOOL)
• • Introduction Spyder
• • Setting working Directory
• • Creating and saving a script file
• • File execution, clearing console, removing variables from environment, clearing environment
• • Commenting script files
• • Variable creation
• • Arithmetic and logical operators
• • Data types and associated operations
• Week 2:
• Sequence data types and associated operations
• •        Strings
• •        Lists
• •        Arrays
• •        Tuples
• •        Dictionary
• •        Sets
• •        Range
• NumPy
• •        ndArray
• Week 3:
• Pandas dataframe and dataframe related operations on Toyota Corolla dataset
• Exploratory data analysis
• Data preparation and preprocessing
• Data visualization on Toyoto Corolla dataset using matplotlib and seaborn libraries
• Scatter plot
• Line plot
• Bar plot
• Histogram
• Box plot
• Pair plot
• Control structures using Toyota Corolla dataset
• if-else family
• for loop
• for loop with if break
• while loop
• Functions
• Week 4: CASE STUDY
• Regression
• Predicting price of pre-owned cars
• Classification
• Classifying personal income
###### CRITERIA TO GET A CERTIFICATE:

Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

If you have not registered for exam kindly register Through https://examform.nptel.ac.in/