Showing posts with label #swayam. Show all posts
Showing posts with label #swayam. Show all posts

Saturday, March 28, 2020

2020- NPTEL Python for Data Science Assignment 2 solutions| 100% correct...



Find the solutions\answers in this video for the below questions : 1)Which of the following sequence data type is defined by enclosing the elements in parentheses ‘()’? 2)Which of the following statement is not valid about Numpy ‘Arrays’? 3)The command to access the last element from the array “a” is__ import array as arr a = arr.array('d', [2.5, 3.5, 4.5]) 4)Create an array ‘x’ with values 0 to 9 and find what is the command to extract the elements in the following sequence - array ([5,3,1])? 5)What will be the output after executing the following codes? x=(0,8,9,15,17,18) y=slice(1,-2) 6)The method used to increase the length of the list by number of elements in its argument. 7)The function that returns the indices of the sorted elements. 8)Create two tuples tuple=(2,4,6,3,7) tuple1=(1,2,3) Find out which of the following code does not work on a tuple 9)The command to find the number of elements in the following array “N” is import numpy as np N=np.array([24, None , 29, 'str', np.nan, 23,20,(),[], ...]) 10)Which of the following is not a valid syntax for creating a Set ‘M’ in Python? M = set([11,12],[13,14],[14,15]) 11)What will be the output after executing the following codes? S={12,13,14,15} S.intersection_update({17,13,14,16}) print(S) 12)Which of the following command returns the set of all elements from both sets, a and b? 13)What will be the output of ndarray.ndim attribute? 14)For dictionary d = {“plum ":0.66, "pears ":1.25,"oranges ":0.50, “apple”:0.75 }, which of the following statement correctly updates the price of oranges to 0.90? 15)Which of the following command(s) is/are used to join arrays? 16)What will be the output of the dictionary ‘c’? 17)The output of the code given below is n = [x*x for x in range(4)] print(n) 18)The output of the code given below is list = [2, 4, 6, 8] a = (x**3 for x in list) print(next(a)) 19)Which of the following is not possible in sequence datatypes? 20)Which of the following commands will give you a new numpy array with Boolean values? ======================================================= Subscribe jaganInfo channel to get more related videos. Thanks for your support to make more videos. ========================================================