Results for "Python NPTEL"
Python with Data Science

Assignment 3

Due date: 2019-09-23, 23:59 IST.
Your last recorded submission was on 2019-09-17, 17:21 IST
Get description about the data files by clicking on the following links :

mtcars_DataDescription

Diamond_DataDescription

Churn_DataDescription
1 point
The command used for reading a text file in python is: -
 
 
 
 
1 point
The command used for line plot from the package Matplotlib?
 
 
 
 
1 point
From the given dataset ‘mtcars.csv, plot a histogram to check the frequency distribution of the variable ‘mpg’ (Miles per gallon). The interval having the
   highest frequency is: -
 
 
 
 
1 point
Which of the following can be inferred from scatter plot of ‘mpg’ (Miles per gallon) vs ‘wt’ (Weight of car) from the dataset mtcars.csv?
 
 
 
 
1 point
The command from seaborn library that is used to plot the relationship between two numerical variables 
 
 
 
 
1 point
The function from seaborn library that combines regplot() and FacetGrid is
 
 
 
 
1 point
The visual representation of the statistical five number summary of variable (s) is given by
 
 
 
 
1 point
Plot a boxplot for “price” vs “cut” from the dataset diamond.csv. Which of the categories under “cut” have the highest median price?
 
 
 
 
1 point
Create a frequency table (one-way table) for the variable “cut” from the dataset diamond.csv. What is the frequency for the cut type “Ideal”?
 
 
 
 
1 point
The probability of two different events occurring at the same time is known as
 
 
 
 
1 point
The command to detect NaN (null) values in pandas dataframes is
 
 
 
 
1 point
The command to identify the data type of a column in the dataframe is
 
 
 
 


Read the given data churn.csv and save it as a dataframe called churn, and answer the questions from 13 to 18

1 point
The no. of duplicate records in the churn dataframe based on the cutomerID column are
 
 
 
 
1 point
In the churn dataframe, what are the total no. of missing values for the variable TotalCharges?
 
 
 
 
1 point
From the churn dataframe, what is the average monthly charge paid by a customer for the services he/she has signed up for?
 
 
 
 
1 point
In the churn dataframe, under the variable Dependents how many records have “1@#" ?
 
 
 
 
1 point
The data type of the variable tenure from the churn dataframe is
 
 
 
 
1 point
The command to replace ‘Four’ by 4 and ‘One’ by 1 under the variable “tenure” of the churn dataframe: -
 
 
 
 
1 point
The Pearson correlation coefficient value ranges from
 
 
 
 
1 point
In control structures, to mark the beginning of sequence of operations, ----- is used
 
 
 
 
You may submit any number of times before the due date. The final submission will be considered for grading.

netaji gandi Monday, September 23, 2019
Programming, Data Structures And Algorithms Using Python

Week 7 Quiz

Due date: 2019-09-18, 23:59 IST.
Your last recorded submission was on 2019-09-11, 15:58 IST
All questions carry equal weightage. All Python code is assumed to be executed using Python3. You may submit as many times as you like within the deadline. Your final submission will be graded.
Note:
  • If the question asks about a value of type string, remember to enclose your answer in single or double quotes.
  • If the question asks about a value of type list, remember to enclose your answer in square brackets and use commas to separate list items.
Given the following permutation of a,b,c,d,e,f,g,h,i,j, what is the next permutation in lexicographic (dictionary) order? Write your answer without any blank spaces between letters.
    eibjdhgfca
    [e,i,b,j,f,a,c,d,g,h]
2.5 points
2.5 points
We want to add a function listmax() to the class Node that implements user defined lists such that listmax() computes the maximum value in a list where values are of type int.
An incomplete implementation of listmax() given below. You have to provide expressions to put in place of AAABBB and CCC.
    
     def listmax(self):
        if self.value == None:
            return(AAA)
        elif self.next == None:
            return(BBB)
        else:
            return(CCC)
 
 
 
 
2.5 points
Suppose we add this function foo() to the class Tree that implements search trees. For a name mytreewith a value of type Tree, what would mytree.foo() compute?
    def foo(self):
        if self.isempty():
            return(0)
        elif self.isleaf():
            return(1)
        else:
            return(self.left.foo() + self.right.foo()))
 
 
 
 
Inorder traversal of a binary tree has been defined in the lectures. A postorder traversal lists the vertices of a binary tree (not necessarily a search tree) as follows:
  • Print the left subtree in postorder.
  • Print the right subtree in postorder.
  • Print the root. 
Suppose we have a binary tree with 10 nodes labelled a, b, c, d, e, f, g, h, i, j, with postorder traversal ehicbjfadg and inorder traversal ehbicgjafd. What is the left child of the root node?
  [b]

netaji gandi Tuesday, September 17, 2019
NPTEL » Programming, Data Structures And Algorithms Using Python

Week 6 Quiz

Due date: 2019-09-11, 23:59 IST.
Your last recorded submission was on 2019-09-11, 15:49 IST
All questions carry equal weightage. All Python code is assumed to be executed using Python3. You may submit as many times as you like within the deadline. Your final submission will be graded.
Note:
  • If the question asks about a value of type string, remember to enclose your answer in single or double quotes.
  • If the question asks about a value of type list, remember to enclose your answer in square brackets and use commas to separate list items.
2.5 points
Suppose u and v both denote sets in Python. Under what condition can we guarantee that u - (u - v) == v?
 
 
 
 
2.5 points
Suppose u and v both denote sets in Python. Under what condition can we guarantee that u|v == u^v?
 
 
 
 
Suppose we insert 97 into the max heap [98,67,89,38,42,54,89,17,25]. What is the resulting heap?
[98,97,89,38,67,54,89,17,25,42]
2.5 points
Suppose we we apply delete_max() twice to the heap [100,97,93,38,67,54,93,17,25,42].  What is the resulting heap?
[93,67,93,38,42,54,25,17]

netaji gandi Wednesday, September 11, 2019
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
 
 
 
 

netaji gandi

OBJECT ORIENTED PROGRAMMING USING JAVA LAB

Java Programming Lab Experiments VR-23 2025-26 Java Programming Lab Experiments Experiment 1: Fibonacci Sequence The F...