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

Saturday, March 28, 2020

NPTEL Python for Data Science Week 4 Assignment 4 answers |2020|99.9% ac...





Code : Assignment 4 code in google drive. If you are downloading this file , please subscribe and like . Advance Thanks.

https://drive.google.com/file/d/1dOZ-YHLRCaSq_l7ffW3b2u5gAgnrUw9p/view


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. ========================================================

NPTEL Python for Data Science Assignment 3 answers | 2020 Week 3 |99.9% ...



1)Pandas features a number of functions for reading data as a DataFrame object. Which of the following commands are valid? 2)Which of the following is a valid indexing option with DataFrames? 3)Which of the following function allows the use of ‘Lambda expression’ while querying the data? 4)While reading comma-separated values (csv) file into DataFrame., which of the following will be used to set the first column as the index column? 5)Read the given dataset “Tips.csv” as a dataframe “Data”. Which of the following command(s) is/are correct to extract the columns in the following sequence - Time, TotalBill, Tips? 6)Read the given excel sheet ‘Tips1.xlsx’ as a dataframe ‘Data1’. Identify which of the following command (s) is/are correct to merge the two data frames ‘Data’ and ‘Data1’ by columns? 7)Copy the 'Data2' dataframe as 'Data3' (Data3 = Data2.copy()) and identify the command to find the total tips received across Day’s from the dataframe ‘Data3’? 8)Copy the 'Data2' dataframe as 'Data3' (Data3 = Data2.copy()) and find which of the following command (s) gives the count of the Time (‘Dinner' or 'Lunch') across gender? 9)Which of the following plot is a visual representation of the statistical five-number summary of a data? 10)Which of the following statement is not true about histograms? 11)If you have column with categorical variables, which will be the appropriate method to fill in the NaN’s present in the column? 12)Which of the following is not the right command to fill NaN values? 13)For the given dataframe “Data3” plot a histogram for the variable ‘TotalBill’ to check which range has the highest frequency 14)For the given dataframe “Data3” draw a bar chart for the variable “Day”. Identify the category with the maximum count 15)Find the mean of the ‘TotalBill’, ‘Tips’ and ‘Size’ across Days from the dataframe ‘Data3’? 16)On which day sum of the total bill was maximum? 17)What will be the output of ‘a’ and ‘b’? 18) n Pandas library, Dataframe class provides a member function to find duplicate rows based on all columns. Identify the right option. 19)What does the following command do? df.dropna(axis=0, how='all') ? 20)Correlation between two variables X&Y is 0.85. Now, after adding the value 2 to all the values of X, the correlation co-efficient will be --------------------- Practice Assignment 3 --------------------- 1) 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? Answer : a) As weight of the car increases, the mpg decreases 2) Plot a boxplot for “price” vs “cut” from the dataset “diamond.csv”. Which of the categories under “cut” have the highest median price? Answer : d) Fair 3) In the churn.csv dataframe, what are the total no. of missing values for the variable TotalCharges? Answer : c) 15 4) The command used for line plot from the package Matplotlib? Answer : a) plot() 5) The probability of two different events occurring at the same time is known as Answer : c) Joint probability