NPTEL » Python for Data Science

Assignment 2

Due date: 2019-09-11, 23:59 IST.
Your last recorded submission was on 2019-09-10, 10:56 IST
1 point
Package that deals with dataframe is
 
 
 
 
1 point
The data type of the following python object 'a' is: a={23, 24, 25, 26, 27}
 
 
 
 
1 point
Variable ‘a’ is defined as
       a = ‘gOOd moRning’
       Command to convert ‘a’ from ‘gOOd moRning’ to ‘Good Morning’ is:-
 
 
 
 
1 point
Which of the following python data structure is immutable?
 
 
 
 
1 point
Identify the braces used to create a dictionary in Python.
 
 
 
 
1 point
The command used to add elements to a list
 
 
 
 

Using the list ‘Stationery’ answer questions 7-8
Product = ['Pencil', 'Pen', 'Eraser', 'Pencil Box', 'Scale']
Price= [5, 10, 2, 20, 12]  
Brand = ['Camlin', 'Rotomac', 'Nataraj', 'Camel', 'Apsara']
Stationery = [Product, Price, Brand]
1 point
The command to add “Notebook” as the first element inside the first level of the list      “Stationery” is:-
 
 
 
 
1 point
Command to replace the element of Brand, “Camel” with “Camlin” inside the list is:-
 
 
 
 
1 point
The list "Months" is defined as:-

       Months = ['Jan', 'Mar', 'June', 'Aug', 'June', 'Feb', 'Nov', 'Dec', 'June', 'Apr', 'May',     'June']

       Which of the following commands returns the number of occurrences of ‘June’?
 
 
 
 
1 point
 Choose the correct command to sort 'Ages' in ascending order

    Ages = [ ’20’, ‘26’, ‘56’, ‘54’, ‘32’, ‘28’, ‘23’, ‘99’, ‘87’, ‘10’, ‘65’, ‘88’, ‘66’,
                  ‘48’, ‘42’, ‘27’, ‘33’, ‘38’,  ‘83’, ‘94’, ‘66’, ‘44’]
 
 
 
 

Answer questions 11 and 12 using the information given below: 
   
 D = [‘MONDAY’, ‘TUESDAY’,  ‘WEDNESDAY’, ‘THURSDAY’, ‘FRIDAY’, ‘SATURDAY’, ‘SUNDAY’]
1 point
 The command to print WEDNESDAY, THURSDAY from the list “D” is
 
 
 
 
1 point
 The command used to reverse the above list “D” is:-
 
 
 
 
1 point
 The command to clear all the elements from a Set is:-
 
 
 
 

Answer questions 14 and 15 using the information given below:   
Mylist =[‘a’, ‘a’, ‘b’, ‘b’, ‘b’, ‘c’, ‘c’, ‘d’, ‘e’] 
1 point
 The output of the code: Mylist.index(‘d’) is
 
 
 
 
1 point
 The output after you run the command:
         Mylist.pop(0)         print(Mylist)
 
 
 
 
1 point
 The command to find the number of elements in the following list “N
          N = [24, 27, 29, 26, 25, 23, 20]
 
 
 
 

Create a dictionary ‘Country’ that maps the following countries to their capitals respectively. 

1 point
 The command to replace “Sydney” with “Canberra” is:-
 
 
 
 


Create the following sets X1 and X2 using the data provided below and answer the questions 18 and 19

1 point
 The output of X1.intersection(X2) will be
 
 
 
 
1 point
 The command X1.symmetric_difference(X2)
 
 
 
 
1 point
Which of the following is a code template for creating objects in Python?
 
 
 
 


Create the following Matrix “Y” in Python and answer questions 21 to 23 :

1 point
  The determinant of the matrix “Y” rounded off to the zeroth decimal place is
 
 
 
 
1 point
  Inverse of matrix “Y” rounded off to second decimal place is

 ([[- 0.73, 0.68, 0.11],
 [0.09,  -0.27, 0.04],
 [0.18,  0.05,  -0.13]])

([[ 0.73, -0.68, -0.11],
[-0.09,  0.27, -0.04],
[-0.18,  0.05,  0.13]])

 ([[ 0.73, 0.68, 0.11],
[0.09,  0.27, 0.04],
[0.18,  0.05,  0.13]])

([[- 0.73, -0.68, -0.11],
[-0.09,  -0.27, -0.04],
[-0.18,  -0.05, -0.13]])
1 point
  The column sum of YT is
 
 
 
 

2 comments

  1. Sir can you please send assignment 3 answers of course Python for data science

    ReplyDelete
  2. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. https://catcherrors.com/repos/flutter/flutter

    ReplyDelete

NPTEL Programming in Java Jan 2024 Week 11

  Week 11 : Programming Assignment 1 Due on 2024-04-11, 23:59 IST The following code is missing some information needed to run the code. Add...