Data Science Interview Preparation

Python Data Science Interview Question MCQs - Part 2

 

1. Train_set = np.array([1, 2, 3]) and test_set = np.array([[0, 1, 2], [1, 2, 3]]) and final resulting_set --> [[1, 2, 3], [0, 1, 2], [1, 2, 3]] then how would you join the two arrays??





ANSWER= C) Explain:- Both option A and B would do horizontal stacking, but we would like to have vertical stacking. So option C is correct.

 

2. Given two lists: a = [1,2,3,4,5] and b = [6,7,8,9] The task is to create a list which has all the elements of a and b in one dimension. Output: a = [1,2,3,4,5,6,7,8,9] Which of the following option would you choose?





ANSWER= B) Explain:-

 

3. While reading a csv file with numpy, you want to automatically fill missing values of column “Date_Of_Joining” with date “01/01/2010”. Name Age Date_Of_Joining Total_Experience Andy 20 01/02/2013 0 Mandy 30 01/05/2014 10 Sandy 10 0 Bandy 40 01/10/2009 20 Which command will be appropriate to fill missing value while reading the file with numpy?





ANSWER= A) Explain:- A is correct

 

4. You have uploaded the dataset in csv format on google spreadsheet and shared it publicly. You want to access it in python, how can you do this? Note: Library StringIO has been imported as StringIO.





ANSWER= A) Explain:- A is correct

 

5. tuple given below: tup = (1, 2, 3, 4, 5 ) Now, you want to update the value of this tuple at 2nd index to 10. Which of the following option will you choose?





ANSWER= D) Explain:- A tuple cannot be updated.

 

6. Read a website which has url as “www.abcd.org”. Which of the following options will perform this task?





ANSWER= C) Explain:-

 

7.Which of the following is a correct implementation of mean squared error (MSE) metric?





ANSWER= B) Explain:-

 

8.Which of the following is the correct extension of the Python file ?





ANSWER= B) Explain:-

 

9. Is Python code compiled or interpreted?





ANSWER= B) Many languages have been implemented using both compilers and interpreters, including C, Pascal, and Python. Explain:-

 

10. what will be value of the python expression 6 + 3 % 5?





ANSWER= c) Order of expression will be % then +. Explain:-
 




  © Copyright 2022, crackdatascienceinterview.in. All rights reserved.
'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();
Theme images by Barcin. Powered by Blogger.